<?php
goto Tsnoa;
Tsnoa:
defined("IN_IA") or die("Access Denied");
goto PbF7L;
vVhPH:
require_once MODULE_ROOT . "/mii/func/functions.php";
goto Wljdc;
GcCbC:
require MODULE_ROOT . "/mii/class/ucode.class.php";
goto vVhPH;
um0Eq:
require MODULE_ROOT . "/mii/class/membercard.class.php";
goto GcCbC;
PbF7L:
define(MODULE_ROOT, IA_ROOT . "/addons/mii_ang");
goto um0Eq;
Wljdc:
class Mii_angModuleWxapp extends WeModuleWxapp
{
    const TABLE = "mii_ang";
    private $gpc;
    private $w;
    private $openid;
    public function __construct()
    {
        goto aI0Ma;
        Abo0j:
        $this->gpc = $_GPC;
        goto A2NQu;
        YYHqj:
        $this->openid = $_W["openid"];
        goto E2qWZ;
        BobLr:
        global $_GPC;
        goto Abo0j;
        aI0Ma:
        global $_W;
        goto BobLr;
        E2qWZ:
        $this->uniacid = $_W["uniacid"];
        goto quVYn;
        A2NQu:
        $this->w = $_W;
        goto YYHqj;
        quVYn:
        $this->uid = $this->userID();
        goto qNURb;
        qNURb:
    }
    private function userID()
    {
        goto eDIPx;
        mQU2U:
        if (!empty($u["uid"])) {
            goto jMybk;
        }
        goto GcTQ2;
        k9K0a:
        $u = pdo_fetch("SELECT uid FROM " . tablename("mii_ang_user") . " WHERE uPassword=:uPassword", array(":uPassword" => md5($this->openid)));
        goto mQU2U;
        eDIPx:
        $a9P5a = $this->openid;
        goto LQHdr;
        dDNhV:
        kspN5:
        goto tcaYa;
        Ko5hd:
        goto kspN5;
        goto cH_vP;
        t4qw7:
        return $uid;
        goto Ko5hd;
        jQZBg:
        $insdata = array("uniacid" => $this->uniacid, "uPassword" => md5($this->openid), "openid" => $this->openid, "nickname" => $this->w["fans"]["nickname"]);
        goto l2bGI;
        l2bGI:
        pdo_insert("mii_ang_user", $insdata);
        goto UL8pn;
        cH_vP:
        jMybk:
        goto HWe0g;
        LQHdr:
        if ($a9P5a) {
            goto QDw5O;
        }
        goto kEwuP;
        GcTQ2:
        $insdata = '';
        goto jQZBg;
        e3xbq:
        QDw5O:
        goto k9K0a;
        UL8pn:
        $uid = pdo_insertid();
        goto t4qw7;
        HWe0g:
        return $u["uid"];
        goto dDNhV;
        kEwuP:
        return false;
        goto e3xbq;
        tcaYa:
    }
    public function doPageIndexinfo()
    {
        goto iAOg2;
        gaO8G:
        goto fFL8n;
        goto D5EO0;
        T71Oj:
        $ad = $foucs;
        goto hPLvZ;
        OoTZR:
        giDU2:
        goto f9lB4;
        mwBsy:
        $cMX4t = !is_array($men);
        goto mlkbT;
        JjZAl:
        @(include MODULE_ROOT . "/public/site/siteinfo." . $_W["uniacid"] . ".php");
        goto GypNC;
        C2u5H:
        fFL8n:
        goto YDBDY;
        PyTOq:
        foreach ($indexmenu as $key => $m) {
            $indexmenudata[] = array("menutype" => $m["menutype"], "name" => $m["name"], "font_color" => $m["font_color"], "url" => $m["url"], "imageurl" => $_W["attachurl"] . $m["imageurl"]);
            PtzTM:
        }
        goto ypMGQ;
        YDBDY:
        if ($bottommenu) {
            goto ha3ym;
        }
        goto Ki3r2;
        HBMF1:
        $FsRzV = !$bottommenu;
        goto OCHEw;
        DYcC1:
        ha3ym:
        goto HBMF1;
        YnAF9:
        foreach ($ad as $key => $value) {
            $foucs[] = array("imgurl" => $_W["attachurl"] . $value["imgurl"], "interval" => $value["interval"] == '' ? "7200" : $value["interval"], "linkgoodsid" => $value["linkgoodsid"]);
            WKz_d:
        }
        goto RtsuR;
        s0t2w:
        $men = $menArr;
        goto AgKih;
        ZnBS3:
        @(include MODULE_ROOT . "/public/site/bottommenu." . $_W["uniacid"] . ".php");
        goto QAKIT;
        D5EO0:
        NjgXe:
        goto IV5ZW;
        TOHls:
        $menArr = array();
        goto vAkA5;
        f9lB4:
        mmO2p:
        goto Genct;
        QAKIT:
        @(include MODULE_ROOT . "/public/pageinfo/indexPage." . $_W["uniacid"] . ".php");
        goto S0FvR;
        Genct:
        $N9p8r = !is_array($ad);
        goto jbJ3n;
        jbJ3n:
        if ($N9p8r) {
            goto vKibi;
        }
        goto Pfd2i;
        S0FvR:
        $webinfo = $siteinfo["webinfo"];
        goto hzg5R;
        pogYL:
        $bottommenudata = $bottommenudata;
        goto OoTZR;
        vAkA5:
        foreach ($men as $key => $m) {
            $menArr[] = array("id" => $m["id"], "menname" => $m["categoryname"], "bg_color" => $m["bg_color"]);
            I4rUE:
        }
        goto a5k4r;
        cK_nL:
        Dxna8:
        goto C2u5H;
        IV5ZW:
        $E1Wg4 = !$indexmenu;
        goto muXMK;
        vjENA:
        $adinfo = $siteinfo["adinfo"];
        goto dimH0;
        a5k4r:
        OaOqT:
        goto s0t2w;
        hPLvZ:
        vKibi:
        goto mwBsy;
        Pfd2i:
        $foucs = array();
        goto YnAF9;
        O0TPc:
        $indexmenudata = $indexmenudata;
        goto cK_nL;
        LSdmE:
        $info = array("status" => 2, "title" => $indexPage["title"] == '' ? $webinfo["companyname"] : $indexPage["title"], "webinfo" => $webinfo, "ad" => $ad, "men" => $men, "hot" => $hot, "adinfo" => $adinfo, "indexmenu" => $indexmenudata, "bottommenu" => $bottommenudata, "attachurl" => $_W["attachurl"]);
        goto P9YcE;
        WcarA:
        foreach ($bottommenu as $key => $b) {
            $bottommenudata[] = array("color" => $b["font_color"], "selectedColor" => $b["selectfont_color"], "pagePath" => $b["url"], "iconPath" => $_W["attachurl"] . $b["imageurl"], "selectedIconPath" => $_W["attachurl"] . $b["selectimageurl"], "text" => $b["name"]);
            p_gtU:
        }
        goto zTbU5;
        ypMGQ:
        IFSn1:
        goto O0TPc;
        dboRs:
        $indexmenudata = array();
        goto PyTOq;
        RtsuR:
        D_xIY:
        goto T71Oj;
        iAOg2:
        global $_W;
        goto JjZAl;
        muXMK:
        if ($E1Wg4) {
            goto Dxna8;
        }
        goto dboRs;
        tyh6f:
        $hot = $siteinfo["hot"];
        goto vjENA;
        SL4QT:
        $men = $siteinfo["men"];
        goto tyh6f;
        SQEBI:
        $indexmenudata = "-1";
        goto gaO8G;
        AgKih:
        DdAFW:
        goto LSdmE;
        Ki3r2:
        $bottommenudata = "-1";
        goto CWAVW;
        o7fFo:
        $bottommenudata = array();
        goto WcarA;
        dimH0:
        if ($indexmenu) {
            goto NjgXe;
        }
        goto SQEBI;
        CWAVW:
        goto mmO2p;
        goto DYcC1;
        zTbU5:
        mjimW:
        goto pogYL;
        P9YcE:
        return json_encode($info);
        goto nw0ik;
        mlkbT:
        if ($cMX4t) {
            goto DdAFW;
        }
        goto TOHls;
        GypNC:
        @(include MODULE_ROOT . "/public/site/indexmenu." . $_W["uniacid"] . ".php");
        goto ZnBS3;
        hzg5R:
        $ad = $siteinfo["ad"];
        goto SL4QT;
        OCHEw:
        if ($FsRzV) {
            goto giDU2;
        }
        goto o7fFo;
        nw0ik:
    }
    public function doPageTabBarData()
    {
        goto Pmish;
        Hedfr:
        Zhuil:
        goto gq9Dz;
        RoV1o:
        $bottommenudata = array();
        goto fppUh;
        aYA94:
        rMTai:
        goto zoU4D;
        iJost:
        if ($FsRzV) {
            goto rMTai;
        }
        goto RoV1o;
        Pmish:
        global $_W;
        goto nImXL;
        zoU4D:
        return json_encode(array("tabBarData" => $bottommenudata));
        goto xtK1L;
        rkryr:
        $FsRzV = !$bottommenu;
        goto iJost;
        fppUh:
        foreach ($bottommenu as $key => $b) {
            $bottommenudata[] = array("color" => $b["font_color"], "selectedColor" => $b["selectfont_color"], "pagePath" => $b["url"], "iconPath" => $_W["attachurl"] . $b["imageurl"], "selectedIconPath" => $_W["attachurl"] . $b["selectimageurl"], "text" => $b["name"]);
            obSff:
        }
        goto Hedfr;
        nImXL:
        @(include_once MODULE_ROOT . "/public/site/bottommenu." . $_W["uniacid"] . ".php");
        goto rkryr;
        gq9Dz:
        $bottommenudata = $bottommenudata;
        goto aYA94;
        xtK1L:
    }
    public function doPageDecode()
    {
        goto S004D;
        g8oJl:
        $encryptedData = $_GPC["data"];
        goto Sulp2;
        ABhPP:
        $wx = new WxappAccount();
        goto ksg7R;
        PJQhb:
        $iv = $_GPC["iv"];
        goto g8oJl;
        ClClP:
        $de = $this->Depkcs7Encode($encryptedData, $iv, $skey);
        goto ibvDf;
        ksg7R:
        $wx->account["key"] = $_W["account"]["key"];
        goto nPxoe;
        Sulp2:
        $code = $_GPC["code"];
        goto coERr;
        aJCdx:
        $skey = $resInfo["session_key"];
        goto ClClP;
        Ifhsk:
        $resInfo = $wx->getOauthInfo($code);
        goto aJCdx;
        ibvDf:
        return json_encode(array("status" => $de["phoneNumber"] ? "1" : "2", "msg" => $de["phoneNumber"] ? "解密成功" : "解密失败，请重新尝试", "phoneNumber" => $de["phoneNumber"]));
        goto WGWu0;
        S004D:
        global $_W, $_GPC;
        goto PJQhb;
        coERr:
        load()->classs("wxapp.account");
        goto ABhPP;
        nPxoe:
        $wx->account["secret"] = $_W["account"]["secret"];
        goto Ifhsk;
        WGWu0:
    }
    private function Depkcs7Encode($encrypt_data, $iv, $skey)
    {
        goto jYfKh;
        jYfKh:
        $aesKey = base64_decode($skey);
        goto EQY5v;
        an0LF:
        $aesCipher = base64_decode($encrypt_data);
        goto SlXCj;
        EQY5v:
        $aesIV = base64_decode($iv);
        goto an0LF;
        REoZA:
        $dataObj = json_decode($result, true);
        goto HoqBG;
        SlXCj:
        $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV);
        goto REoZA;
        HoqBG:
        return $dataObj;
        goto S4Vxn;
        S4Vxn:
    }
    public function doPageServiceinfo()
    {
        goto KvlIQ;
        Mm1KK:
        $uniacid = $_W["uniacid"];
        goto FIMAx;
        FIMAx:
        $men = pdo_fetchall(" SELECT id,categoryname FROM" . tablename("mii_ang_class") . " WHERE uniacid=:uniacid AND ishide=:ishide ORDER BY category_order DESC", array(":uniacid" => $uniacid, ":ishide" => "1"));
        goto b3suY;
        KvlIQ:
        global $_W;
        goto cms0E;
        X136y:
        foreach ($men as $key => $m) {
            $menArr[] = array("typeid" => $m["id"], "name" => $m["categoryname"]);
            LSVnc:
        }
        goto RhIFh;
        TOlDK:
        if ($cMX4t) {
            goto CpgxI;
        }
        goto jIpAf;
        BDIi_:
        $men = $menArr;
        goto u82uU;
        jIpAf:
        $menArr = array();
        goto X136y;
        k3iH6:
        return json_encode($serviceinfo);
        goto TH4Ov;
        u82uU:
        CpgxI:
        goto Q3L9t;
        cms0E:
        @(include MODULE_ROOT . "/public/pageinfo/servicePage." . $_W["uniacid"] . ".php");
        goto Mm1KK;
        RhIFh:
        HexF5:
        goto BDIi_;
        Q3L9t:
        $serviceinfo = array("title" => $servicePage["listtitle"] == '' ? "服务项目" : $servicePage["listtitle"], "menlist" => $men, "attachurl" => $_W["attachurl"]);
        goto k3iH6;
        b3suY:
        $cMX4t = !is_array($men);
        goto TOlDK;
        TH4Ov:
    }
    public function doPageTechinfo()
    {
        goto IVJ6D;
        Mgnce:
        $men = pdo_fetchall(" SELECT id,categoryname FROM" . tablename("mii_ang_class") . " WHERE uniacid=:uniacid AND ishide=:ishide ORDER BY category_order DESC", array(":uniacid" => $uniacid, ":ishide" => "1"));
        goto di0ha;
        IVJ6D:
        global $_W;
        goto HFaDU;
        zL2W4:
        $serviceinfo = array("title" => $techPage["listtitle"] == '' ? "技师列表" : $techPage["listtitle"], "menlist" => $men, "attachurl" => $_W["attachurl"]);
        goto LFfaz;
        p3hwz:
        if ($cMX4t) {
            goto FZIn4;
        }
        goto uSIZ7;
        Q9ajQ:
        FZIn4:
        goto zL2W4;
        di0ha:
        $cMX4t = !is_array($men);
        goto p3hwz;
        JyHT1:
        Vjem5:
        goto c_4sD;
        uSIZ7:
        $menArr = array();
        goto Vrb10;
        YRY63:
        $uniacid = $_W["uniacid"];
        goto Mgnce;
        HFaDU:
        @(include MODULE_ROOT . "/public/pageinfo/techPage." . $_W["uniacid"] . ".php");
        goto YRY63;
        LFfaz:
        return json_encode($serviceinfo);
        goto rCPbA;
        c_4sD:
        $men = $menArr;
        goto Q9ajQ;
        Vrb10:
        foreach ($men as $key => $m) {
            $menArr[] = array("typeid" => $m["id"], "name" => $m["categoryname"]);
            ZZwq7:
        }
        goto JyHT1;
        rCPbA:
    }
    public function doPageGetgoodslist()
    {
        goto g4482;
        Tk8v8:
        $psize = 5;
        goto YozPZ;
        g4482:
        global $_GPC;
        goto VZUqq;
        VZUqq:
        $uniacid = $this->uniacid;
        goto NraGh;
        IPQpm:
        YOt7I:
        goto KB4JP;
        KB4JP:
        $sotid = "AND tid=" . $tid;
        goto MfvkJ;
        Jomv3:
        $show = "false";
        goto YNKhY;
        ow3Sz:
        $resdata = json_encode(array("goods" => $goods, "show" => $show));
        goto L1ifQ;
        LHbze:
        $goods = change_medias($goods, "titlepic");
        goto ow3Sz;
        MfvkJ:
        DcBHp:
        goto IizQ5;
        L1ifQ:
        return $resdata;
        goto ULFpk;
        T3RWC:
        goto UhcQD;
        goto f6_j4;
        jXIzc:
        $countSql = "SELECT COUNT(*)FROM " . tablename("mii_ang_goods") . "WHERE 1 AND uniacid={$uniacid} AND grounding = 1 {$sotid} ORDER BY orderid DESC";
        goto yl38R;
        f6_j4:
        YjglE:
        goto Jomv3;
        uRyXl:
        $pindex = max(1, intval($page));
        goto Tk8v8;
        iCdoL:
        $pager = pagination($total, $pindex, $psize, $url = '', $context = array("before" => 1, "after" => 1, "ajaxcallback" => '', "callbackfuncname" => ''));
        goto HSLaD;
        o1TdW:
        $show = "true";
        goto T3RWC;
        YNKhY:
        UhcQD:
        goto LHbze;
        SPXUy:
        $sotid = '';
        goto uhYTZ;
        YozPZ:
        $sql = "SELECT id,goodsname,titlepic,price,summary FROM" . tablename("mii_ang_goods") . "WHERE 1 AND uniacid={$uniacid} AND grounding = 1 {$sotid} ORDER BY orderid DESC LIMIT " . ($pindex - 1) * $psize . "," . $psize;
        goto Z5w_k;
        uhYTZ:
        goto DcBHp;
        goto IPQpm;
        IizQ5:
        $page = $_GPC["page"];
        goto uRyXl;
        Z5w_k:
        $goods = pdo_fetchall($sql);
        goto jXIzc;
        wbBMg:
        if ($tid) {
            goto YOt7I;
        }
        goto SPXUy;
        NraGh:
        $tid = $_GPC["tid"] == "all" ? 0 : $_GPC["tid"];
        goto wbBMg;
        yl38R:
        $total = pdo_fetchcolumn($countSql);
        goto iCdoL;
        HSLaD:
        if (empty($goods)) {
            goto YjglE;
        }
        goto o1TdW;
        ULFpk:
    }
    public function doPageGetgoodsinfo()
    {
        goto m1R38;
        m1R38:
        $uniacid = $this->w["uniacid"];
        goto ItksL;
        N0_Ws:
        if ($BXdbz) {
            goto TBmq3;
        }
        goto iciog;
        StbL9:
        $goods["attachurl"] = $this->w["attachurl"];
        goto fLIKG;
        Ngpuw:
        $BXdbz = !$goods["pics"];
        goto N0_Ws;
        fLIKG:
        return json_encode($goods);
        goto SEm7U;
        iciog:
        $goods["pics"] = explode(",", $goods["pics"]);
        goto K7L10;
        K7L10:
        TBmq3:
        goto StbL9;
        C3cCw:
        $goods = pdo_get("mii_ang_goods", array("id" => $gid, "uniacid" => $uniacid));
        goto Ngpuw;
        ItksL:
        $gid = $this->gpc["gid"];
        goto C3cCw;
        SEm7U:
    }
    public function doPageGetservicelist()
    {
        goto P1BpT;
        VRNRA:
        YK4Mx:
        goto GnRsA;
        M7DU2:
        Qp67O:
        goto dmDMO;
        uktxE:
        foreach ($techlist as $t_k => $t_v) {
            goto UDo1I;
            tE3PI:
            $tvalue[] = $t_v["tname"];
            goto pny3s;
            UDo1I:
            $tArr[$t_v["id"]] = $t_v["tname"];
            goto g91np;
            pny3s:
            ogWBO:
            goto nP_82;
            g91np:
            $tkey[] = $t_v["id"];
            goto tE3PI;
            nP_82:
        }
        goto UZVyP;
        y9N92:
        foreach ($service as $key => $value) {
            goto G1qzu;
            eUbg5:
            wggJA:
            goto p3BpK;
            pJqqi:
            $svalue[] = $value["goodsname"];
            goto eUbg5;
            rROjW:
            $skey[] = $value["id"];
            goto pJqqi;
            G1qzu:
            $sArr[$value["id"]] = $value["goodsname"];
            goto rROjW;
            p3BpK:
        }
        goto uMLv1;
        Ym_uv:
        foreach ($service as $key => $s) {
            goto y2laB;
            Lp2LE:
            $goods = $s;
            goto BYeV3;
            BkDVx:
            SjXez:
            goto wmJUc;
            y2laB:
            $TaDn_ = !($s["id"] == $gid);
            goto ouEo5;
            BYeV3:
            sWshr:
            goto BkDVx;
            ouEo5:
            if ($TaDn_) {
                goto sWshr;
            }
            goto Lp2LE;
            wmJUc:
        }
        goto M7DU2;
        UZVyP:
        fiqWl:
        goto VRNRA;
        D7P_j:
        return json_encode($resArr);
        goto gxU6D;
        P1BpT:
        $uniacid = $this->w["uniacid"];
        goto rnJwd;
        CTcnk:
        caTyd:
        goto ph0Ns;
        SHyvg:
        $techlist = pdo_fetchall("SELECT id,tname FROM" . tablename("mii_ang_tech") . "WHERE uniacid=:uniacid AND status =:status AND  FIND_IN_SET(" . $tid . ",classid)<>0   ORDER BY orderid DESC ", array(":uniacid" => $this->w["uniacid"], "status" => "1"));
        goto R4Xql;
        RHkpU:
        $service = pdo_fetchall("SELECT id,goodsname,summary,price,titlepic,tid FROM" . tablename("mii_ang_goods") . " WHERE uniacid=:uniacid AND grounding=:grounding", array(":uniacid" => $uniacid, ":grounding" => "1"));
        goto hYhUx;
        Z5USo:
        $tid = $goods["tid"];
        goto SHyvg;
        dIHgH:
        if ($W1b8u) {
            goto IAGD4;
        }
        goto kbAMa;
        ti8mx:
        $PA9Ga = !$service;
        goto I1Nbg;
        OgQ2S:
        $cardNum = pdo_fetchcolumn($CardcountSql, array(":uniacid" => $this->w["uniacid"], ":uPassword" => md5($this->w["openid"]), ":use" => "-1", ":condition" => $goods["price"], ":roof" => "MII", ":endtime" => $this->w["timestamp"]));
        goto fZq2B;
        hYhUx:
        $goods = array();
        goto Ym_uv;
        JmMWt:
        if ($ZY7o9) {
            goto caTyd;
        }
        goto G8DGx;
        ClWPC:
        IAGD4:
        goto LbW5M;
        pZcmj:
        if ($MgWdE) {
            goto YK4Mx;
        }
        goto Rj12a;
        rnJwd:
        $gid = $this->gpc["gid"];
        goto RHkpU;
        ph0Ns:
        $W1b8u = empty($skey);
        goto dIHgH;
        t1MpA:
        $tsid = $tkey[0];
        goto UdIaR;
        LbW5M:
        $CardcountSql = "SELECT COUNT(*) FROM " . tablename("mii_ang_user") . " u LEFT JOIN " . tablename("mii_ang_ucard") . " uc ON u.uid=uc.uid LEFT JOIN " . tablename("mii_ang_card") . " c ON uc.cid=c.id WHERE u.uniacid = :uniacid AND u.uPassword = :uPassword AND uc.use=:use AND c.condition <= :condition AND c.roof = :roof AND c.endtime >= :endtime ";
        goto OgQ2S;
        fr4GF:
        INf9i:
        goto SpVKF;
        gQ6EN:
        $sArr = array();
        goto y9N92;
        GnRsA:
        $yb1k2 = !$tArr;
        goto weGhf;
        R4Xql:
        $MgWdE = !$techlist;
        goto pZcmj;
        Rj12a:
        $tArr = array();
        goto uktxE;
        dmDMO:
        $goods["attachurl"] = $this->w["attachurl"];
        goto Z5USo;
        I1Nbg:
        if ($PA9Ga) {
            goto INf9i;
        }
        goto gQ6EN;
        uMLv1:
        uuySj:
        goto fr4GF;
        UdIaR:
        awHMd:
        goto ti8mx;
        G8DGx:
        $sArr = array("0", "没有服务选项");
        goto CTcnk;
        kbAMa:
        $sid = array_search($gid, $skey);
        goto ClWPC;
        SpVKF:
        $ZY7o9 = !empty($sArr);
        goto JmMWt;
        fZq2B:
        $resArr = array("goods" => $goods, "skey" => $skey, "svalue" => $svalue, "service" => $sArr, "sid" => $sid, "tsid" => $tsid, "tkey" => $tkey, "tvalue" => $tvalue, "gid" => $gid, "tArr" => $tArr, "cardNum" => $cardNum);
        goto D7P_j;
        weGhf:
        if ($yb1k2) {
            goto awHMd;
        }
        goto t1MpA;
        gxU6D:
    }
    public function doPageAbout()
    {
        goto CAOWA;
        f_dqn:
        return json_encode(array("data" => $data, "title" => $aboutPage["title"] == '' ? "关于我们" : $aboutPage["title"]));
        goto igWoL;
        Ymh0T:
        $data["urls"] = $urls;
        goto gea_G;
        gea_G:
        aQLOg:
        goto buiLc;
        buiLc:
        $data["attachurl"] = $this->w["attachurl"];
        goto f_dqn;
        gol86:
        $data = pdo_get("mii_ang_info", array("uniacid" => $this->w["uniacid"]));
        goto HhH0G;
        W1MKq:
        $urls = array();
        goto MXd3x;
        eVWsH:
        pCZqD:
        goto ki_MA;
        HhH0G:
        if ($data["pics"]) {
            goto pCZqD;
        }
        goto J1Y7N;
        J1Y7N:
        $data["pics"] = '';
        goto Fw3Gk;
        ki_MA:
        $data["pics"] = explode(",", $data["pics"]);
        goto W1MKq;
        GU1oH:
        GvKuV:
        goto Ymh0T;
        MXd3x:
        foreach ($data["pics"] as $key => $v) {
            $urls[] = $this->w["attachurl"] . $v;
            WFClu:
        }
        goto GU1oH;
        CAOWA:
        @(include MODULE_ROOT . "/public/pageinfo/aboutPage." . $this->w["uniacid"] . ".php");
        goto gol86;
        Fw3Gk:
        goto aQLOg;
        goto eVWsH;
        igWoL:
    }
    public function doPageGetservicelistintech()
    {
        goto a0Tap;
        nMX6H:
        $tvalue[] = $tech["tname"];
        goto h0_ju;
        sDYV7:
        $sotid = " tid IN (" . $classid . ") AND";
        goto xyOBK;
        FPX2s:
        $class = array_filter(explode(",", $tech["classid"]));
        goto zOHlz;
        z8I0G:
        oZOLd:
        goto LVmy0;
        pwhYS:
        $ZY7o9 = !empty($sArr);
        goto MhL06;
        VL9Hk:
        $tech = pdo_get("mii_ang_tech", array("id" => $tid), array("id", "tname", "classid"));
        goto uQuXx;
        FJCa4:
        goto BWL2c;
        goto TISiv;
        zt9dn:
        if ($ObgHt) {
            goto KLsAf;
        }
        goto FPX2s;
        di_X_:
        KLsAf:
        goto FNcOi;
        Dz4mB:
        $code = array("status" => "2", "msg" => "非法操作");
        goto cRveE;
        DE2eJ:
        if ($AayKE) {
            goto uKilQ;
        }
        goto B2ohh;
        qxJGR:
        goto aCSO0;
        goto EDgTm;
        sgDA3:
        $CardcountSql = "SELECT COUNT(*) FROM " . tablename("mii_ang_user") . " u LEFT JOIN " . tablename("mii_ang_ucard") . " uc ON u.uid=uc.uid LEFT JOIN " . tablename("mii_ang_card") . " c ON uc.cid=c.id WHERE u.uniacid = :uniacid  AND u.uPassword = :uPassword AND uc.use=:use AND c.condition <= :condition AND c.roof = :roof AND c.endtime >= :endtime ";
        goto giMtM;
        EHsc9:
        $y072B = empty($service);
        goto PETTw;
        FzIwl:
        JUU0Q:
        goto sgDA3;
        B2ohh:
        $tsid = array_search($tech["id"], $tkey);
        goto u1FCj;
        JDzim:
        if ($W1b8u) {
            goto JUU0Q;
        }
        goto fANmY;
        uQuXx:
        $tkey[] = $tech["id"];
        goto nMX6H;
        xyOBK:
        aCSO0:
        goto wgOGD;
        R1DHN:
        $W1b8u = empty($skey);
        goto JDzim;
        R57YL:
        $goods = array();
        goto EHsc9;
        TISiv:
        RGI3r:
        goto VL9Hk;
        a0Tap:
        $tid = $this->gpc["tid"];
        goto IVkRw;
        mfjd9:
        if ($PA9Ga) {
            goto oZOLd;
        }
        goto ihquo;
        giMtM:
        $cardNum = pdo_fetchcolumn($CardcountSql, array(":uniacid" => $_W["uniacid"], ":uPassword" => md5($this->w["openid"]), ":use" => "-1", ":condition" => $goods["price"], ":roof" => "MII", ":endtime" => $this->w["timestamp"]));
        goto uFngO;
        fANmY:
        $sid = array_search($goods["id"], $skey);
        goto FzIwl;
        LVmy0:
        $AayKE = !$tech["id"];
        goto DE2eJ;
        wgOGD:
        $service = pdo_fetchall("SELECT id,goodsname,summary,price,titlepic,tid FROM" . tablename("mii_ang_goods") . " WHERE {$sotid}  grounding=:grounding ORDER BY orderid DESC", array(":grounding" => "1"));
        goto R57YL;
        cRveE:
        die(json_encode($code));
        goto FJCa4;
        MfxTY:
        D9JPY:
        goto R1DHN;
        tLoG8:
        $sArr = array("0", "没有服务选项");
        goto MfxTY;
        h0_ju:
        $tArr[$tech["id"]] = $tech["tname"];
        goto PxAv4;
        PxAv4:
        $ObgHt = !$tech["classid"];
        goto zt9dn;
        zOHlz:
        $classid = implode(",", $class);
        goto di_X_;
        FNcOi:
        if ($classid) {
            goto eK5zp;
        }
        goto iGay0;
        GfWWV:
        xrnsZ:
        goto z8I0G;
        Oz1UI:
        $goods = $service[0];
        goto g_lHj;
        iGay0:
        $sotid = " ";
        goto qxJGR;
        yYrNe:
        return json_encode($resArr);
        goto VL2WM;
        uFngO:
        $resArr = array("goods" => $goods, "skey" => $skey, "svalue" => $svalue, "service" => $sArr, "sid" => $sid, "tsid" => $tech["id"], "tkey" => $tkey, "tvalue" => $tvalue, "gid" => $goods["id"], "tArr" => $tArr, "cardNum" => $cardNum);
        goto yYrNe;
        IVkRw:
        if (!empty($tid)) {
            goto RGI3r;
        }
        goto Dz4mB;
        MhL06:
        if ($ZY7o9) {
            goto D9JPY;
        }
        goto tLoG8;
        PETTw:
        if ($y072B) {
            goto nj7Po;
        }
        goto Oz1UI;
        rmtTK:
        $goods["attachurl"] = $this->w["attachurl"];
        goto pm7Gn;
        vlq5J:
        foreach ($service as $key => $value) {
            goto ODAzt;
            c17_0:
            $skey[] = $value["id"];
            goto fL3xs;
            ODAzt:
            $sArr[$value["id"]] = $value["goodsname"];
            goto c17_0;
            SpmBX:
            o6ImD:
            goto q0M14;
            fL3xs:
            $svalue[] = $value["goodsname"];
            goto SpmBX;
            q0M14:
        }
        goto GfWWV;
        ihquo:
        $sArr = array();
        goto vlq5J;
        pm7Gn:
        $PA9Ga = !$service;
        goto mfjd9;
        g_lHj:
        nj7Po:
        goto rmtTK;
        EDgTm:
        eK5zp:
        goto sDYV7;
        VL2WM:
        BWL2c:
        goto S9IBr;
        u1FCj:
        uKilQ:
        goto pwhYS;
        S9IBr:
    }
    public function doPageGetbookpageinfo()
    {
        goto ydhwH;
        ydhwH:
        @(include MODULE_ROOT . "/public/pageinfo/bookPage." . $this->uniacid . ".php");
        goto Nd0Sw;
        Nd0Sw:
        $WjPQy = !empty($bookPage);
        goto adBSC;
        iQCC6:
        return json_encode($bookPage);
        goto O8sAO;
        PMvyB:
        $bookPage = array("title" => "预约中心", "book_Tname" => "姓名", "book_Tphone" => "联系电话", "book_Taddress" => "联系地址", "book_Tservice" => "服务项目", "book_Ttech" => "选择技师", "book_Tdate" => "服务时段", "book_Tcard" => "优惠券", "book_hideaddres" => "1", "book_hidecard" => "1");
        goto pTazN;
        pTazN:
        Oe1_1:
        goto iQCC6;
        adBSC:
        if ($WjPQy) {
            goto Oe1_1;
        }
        goto PMvyB;
        O8sAO:
    }
    public function doPageGetdate()
    {
        goto MG2WL;
        UxvTL:
        $tid = $this->gpc["tid"] ? $this->gpc["tid"] : 0;
        goto UtD0x;
        DI0zo:
        $template["rest_end"] = $template["rest_end"] ? $template["rest_end"] : $def["rest_end"];
        goto cdtMY;
        hhf1i:
        osgDb:
        goto UxvTL;
        h14pV:
        $banArr = pdo_fetchall("SELECT start,`end` FROM " . tablename("mii_ang_timeslot") . " WHERE uniacid=:uniacid AND tid=:tid AND start >= :start AND status=:status ", array(":uniacid" => $this->uniacid, ":tid" => $tid, ":start" => $this->w["timestamp"], ":status" => "1"));
        goto lIRkV;
        XSJbB:
        $def = array("start" => "09:00", "end" => "21:00", "rest_start" => "12:00", "rest_end" => "14:00", "timeinterval" => "30", "rest_week" => '');
        goto zAiy7;
        sgaQX:
        return json_encode(array("status" => -1, "msg" => "您无权操作"));
        goto kheub;
        kheub:
        goto i99BX;
        goto hhf1i;
        zAiy7:
        $template["start"] = $template["start"] ? $template["start"] : $def["start"];
        goto MKlca;
        qySRM:
        $template["rest_start"] = $template["rest_start"] ? $template["rest_start"] : $def["rest_start"];
        goto DI0zo;
        K8LZ_:
        $template["rest_week"] = $template["rest_week"] ? @json_decode($template["rest_week"], true) : '';
        goto h14pV;
        MG2WL:
        if ($this->w["ispost"]) {
            goto osgDb;
        }
        goto sgaQX;
        MKlca:
        $template["end"] = $template["end"] ? $template["end"] : $def["end"];
        goto qySRM;
        ASU4o:
        return json_encode(array("status" => 1, "date" => $date));
        goto JJgJ5;
        JJgJ5:
        i99BX:
        goto DUNDJ;
        cdtMY:
        $template["timeinterval"] = $template["timeinterval"] ? $template["timeinterval"] : $def["timeinterval"];
        goto K8LZ_;
        lIRkV:
        $date = $mii->Days($template["start"], $template["end"], array($template["rest_start"], $template["rest_end"]), $template["timeinterval"], 7, $banArr, $template["rest_week"]);
        goto ASU4o;
        wqNSj:
        $template = pdo_fetch("SELECT t.start,t.end,t.rest_start,t.rest_end,t.timeinterval,t.rest_week FROM" . tablename("mii_ang_tech") . "h LEFT JOIN " . tablename("mii_ang_timetemplate") . " t ON h.timetemplate_id= t.tid ORDER BY t.tid DESC LIMIT 1");
        goto XSJbB;
        UtD0x:
        $mii = m("date");
        goto wqNSj;
        DUNDJ:
    }
    public function doPageSave_book()
    {
        goto R_C4C;
        NQbJd:
        die(json_encode($code));
        goto NXerJ;
        shPFX:
        if ($oQ7dp) {
            goto RwNji;
        }
        goto ozK4P;
        nrucU:
        $endtime = $this->gpc["endtime"];
        goto au4Fn;
        Ud8wO:
        $techStatus = $techStatus["id"];
        goto ySPYc;
        GneQo:
        pdo_update("mii_ang_ucard", array("use" => "1"), array("card_on" => $card_on));
        goto FFwmK;
        jcwvk:
        goto AxgS7;
        goto Zhpp8;
        XxkKj:
        $goods = pdo_get("mii_ang_goods", array("id" => $goodsid), array("goodsname", "price"));
        goto GZNgx;
        HjO0u:
        $token = $this->App_getToken();
        goto XxkKj;
        P4au2:
        Jj3WU:
        goto C321A;
        sPsYD:
        $data = array("uniacid" => $uniacid, "uid" => $this->uid, "goodsid" => $goodsid, "booktime" => date("Y-m-d H:i", $starttime) . "-" . date("Y-m-d H:i", $endtime), "starttime" => $starttime, "endtime" => $endtime, "addtime" => $this->w["timestamp"], "uname" => $uname, "phone" => $phone, "goodsname" => $goods["goodsname"], "price" => $goods["price"], "address" => $address, "techid" => intval($techid), "techname" => $techname);
        goto luGtj;
        FFwmK:
        Xct0d:
        goto PDDfm;
        ooeNU:
        $starttime = $this->gpc["starttime"];
        goto nrucU;
        sUdp5:
        $insorder = pdo_insert("mii_ang_order", $orderArr);
        goto HjA7z;
        q0kVs:
        $phone = $this->gpc["phone"];
        goto ooeNU;
        nHrhM:
        $LSNon = !(!empty($starttime) && !empty($endtime));
        goto qVJIr;
        lFL3g:
        TpBQR:
        goto vVbY5;
        e5gvh:
        $resPayInfo = $this->pay($payData);
        goto CqAHO;
        C321A:
        AxgS7:
        goto TP8Vk;
        gLRNU:
        M8zbs:
        goto ybf8S;
        LcH7a:
        $techStatus = pdo_get("mii_ang_timeslot", array("tid" => $techid, "start" => $starttime, "status" => "1"), array("id"));
        goto Ud8wO;
        gQ1of:
        $orderid = $this->createOrderId($this->uid);
        goto Vfc2T;
        PDDfm:
        pdo_update("mii_ang_timeslot", array("status" => "1"), array("oid" => $oid));
        goto Jfz3n;
        fBi0E:
        if ($G5acY) {
            goto Xct0d;
        }
        goto GneQo;
        E9y0a:
        if ($GdfO_) {
            goto fwjhh;
        }
        goto I12S0;
        HmVqX:
        $uname = $this->gpc["uname"];
        goto q0kVs;
        SiWCw:
        pdo_insert("mii_ang_timeslot", array("uniacid" => $this->uniacid, "sid" => '', "tid" => $techid, "gid" => $goodsid, "oid" => $oid, "start" => $starttime, "end" => $endtime, "status" => "-1"));
        goto IxCXX;
        yQ5Dw:
        $orderArr = array("uniacid" => $this->uniacid, "uid" => $this->uid, "is_pay" => "0", "is_ok" => "0", "goods_id" => $goodsid, "orderid" => $orderid, "tech_id" => $techid, "goods_money" => $goods["price"], "tmoney" => $t_price, "title" => $title, "details" => $details, "addtime" => $this->w["timestamp"], "order_type" => $order_type, "card_id" => $card_id, "card_on" => $card_on, "card_price" => $card_price);
        goto iJT4n;
        ik3MF:
        $order_type = $is_pay == "0" ? "1" : "2";
        goto wQoHF;
        Jfz3n:
        $code = array("is_pay" => "0", "status" => "1", "msg" => "预约成功,是否前往个人中心查看?", "oid" => $oid);
        goto NQbJd;
        IfctN:
        $title = "预约项目:" . $goods["goodsname"];
        goto yQ5Dw;
        qN8rT:
        $GdfO_ = !($this->w["timestamp"] > intval($starttime));
        goto E9y0a;
        GZNgx:
        $info = pdo_get("mii_ang_info", array("uniacid" => $this->w["uniacid"]), array("is_pay"));
        goto VS6tC;
        NXerJ:
        goto Jj3WU;
        goto BYPt3;
        BKAfR:
        $techid = $this->gpc["techid"];
        goto hIT32;
        ybf8S:
        $t_price = $this->usecarddata($card_id, $goods["price"]);
        goto lFL3g;
        I12S0:
        return json_encode(array("status" => 2, "msg" => "服务时间段已无效,请重新选择服务时间段"));
        goto MDmtX;
        hIT32:
        $techname = $this->gpc["techname"];
        goto ciy7K;
        qjaFr:
        $code = array("status" => "2", "msg" => "预约失败");
        goto C1GWF;
        QzCZe:
        RwNji:
        goto qN8rT;
        ySPYc:
        $oQ7dp = empty($techStatus);
        goto shPFX;
        qVJIr:
        if ($LSNon) {
            goto bDfD_;
        }
        goto LcH7a;
        SQysB:
        return json_encode($code);
        goto P4au2;
        C1GWF:
        die(json_encode($code));
        goto jcwvk;
        ozK4P:
        return json_encode(array("status" => 2, "msg" => "该技师在该预约时间段已排满,请重新选择服务时间段"));
        goto QzCZe;
        au4Fn:
        $address = $this->gpc["address"];
        goto BKAfR;
        iJT4n:
        $orderData = array("title" => $title, "openid" => $this->w["openid"], "oid" => $orderid, "price" => $t_price);
        goto sUdp5;
        wQoHF:
        $orderid = '';
        goto gQ1of;
        vVbY5:
        $card_price = $this->cardPrice($goods["price"], $t_price);
        goto nHrhM;
        IxCXX:
        if ($insorder && $orderid) {
            goto yWFwN;
        }
        goto qjaFr;
        k9RIt:
        if ($is_pay == "1" && $t_price > 0) {
            goto yIIFG;
        }
        goto zYV5C;
        Vfc2T:
        $details = json_encode($data);
        goto IfctN;
        iL00q:
        $t_price = $goods["price"];
        goto jlAhs;
        luGtj:
        if (!empty($card_id)) {
            goto M8zbs;
        }
        goto iL00q;
        c5GNu:
        $goodsid = $this->gpc["serviceId"];
        goto HmVqX;
        MDmtX:
        fwjhh:
        goto JAO9d;
        HjA7z:
        $oid = pdo_insertid();
        goto SiWCw;
        BYPt3:
        yIIFG:
        goto e5gvh;
        Zhpp8:
        yWFwN:
        goto psL6U;
        psL6U:
        $payData = $this->buildOrderPayData($orderData);
        goto k9RIt;
        ciy7K:
        $card_id = intval($this->gpc["card_id"]);
        goto xh31r;
        JAO9d:
        bDfD_:
        goto ik3MF;
        VS6tC:
        $is_pay = $info["is_pay"];
        goto sPsYD;
        zYV5C:
        $G5acY = empty($card_on);
        goto fBi0E;
        jlAhs:
        goto TpBQR;
        goto gLRNU;
        CqAHO:
        $code = array("is_pay" => "1", "payInfo" => $resPayInfo, "oid" => $oid, "payData" => $payData);
        goto SQysB;
        R_C4C:
        $uniacid = $this->w["uniacid"];
        goto c5GNu;
        xh31r:
        $card_on = $this->gpc["card_on"];
        goto HjO0u;
        TP8Vk:
    }
    public function doPageBookpaysuccess()
    {
        goto poqR1;
        rtgow:
        $code = array("status" => "2", "msg" => "预约失败，服务器繁忙");
        goto MYZRk;
        Y72xQ:
        pdo_update("mii_ang_ucard", array("use" => "1"), array("uniacid" => $_W["uniacid"], "card_on" => $order["card_on"]));
        goto f4mBD;
        XwuSZ:
        pdo_update("mii_ang_timeslot", array("status" => "1"), array("oid" => $oid));
        goto UO6U1;
        poqR1:
        global $_W, $_GPC;
        goto kqCDr;
        Qphl8:
        $order = pdo_get("mii_ang_order", array("oid" => $oid), array("tmoney", "card_on"));
        goto SdyO1;
        m8b2H:
        BSC_j:
        goto qHdQA;
        BOssL:
        $kcC55 = empty($order["card_on"]);
        goto WoKy6;
        SdyO1:
        if (!empty($order)) {
            goto MlbWw;
        }
        goto t7Vsy;
        f4mBD:
        t06j4:
        goto XwuSZ;
        MYZRk:
        return json_encode($code);
        goto uijh9;
        S6X2V:
        s5i8N:
        goto exEPu;
        t7Vsy:
        $code = array("status" => "2", "msg" => "订单错误,请联系管理员");
        goto Vn52k;
        WoKy6:
        if ($kcC55) {
            goto t06j4;
        }
        goto Y72xQ;
        i_02d:
        $up = pdo_update("mii_ang_order", array("is_pay" => "1", "pay_time" => $_W["timestamp"], "pay_money" => $order["tmoney"]), array("oid" => $oid));
        goto BOssL;
        kqCDr:
        $oid = $_GPC["oid"];
        goto Qphl8;
        uijh9:
        goto s5i8N;
        goto m8b2H;
        PLmFl:
        goto lH9Z5;
        goto pWIu2;
        qHdQA:
        $code = array("status" => "1", "msg" => "预定成功，是否前往个人中心查看？", "rescode" => $rescode);
        goto Dq70d;
        Vn52k:
        return json_encode($code);
        goto PLmFl;
        pWIu2:
        MlbWw:
        goto i_02d;
        Dq70d:
        return json_encode($code);
        goto S6X2V;
        exEPu:
        lH9Z5:
        goto ZJBzX;
        UO6U1:
        if ($up) {
            goto BSC_j;
        }
        goto rtgow;
        ZJBzX:
    }
    public function doPageBookcancelpayorfail()
    {
        goto P4FH2;
        vGOJO:
        FwYeY:
        goto GxwqY;
        zTcJS:
        Qu8hu:
        goto pAD4P;
        JJZy_:
        if (!$oid) {
            goto FwYeY;
        }
        goto BWzSo;
        GxwqY:
        $code = array("status" => "2", "msg" => "请求出错");
        goto EOAwm;
        k7cWL:
        if ($delorder) {
            goto fp_JQ;
        }
        goto uNzlU;
        pAD4P:
        goto U10Xl;
        goto vGOJO;
        BWzSo:
        $delorder = pdo_delete("mii_ang_order", array("oid" => $oid));
        goto k7cWL;
        vzIVi:
        $code = array("status" => "1");
        goto h7__2;
        uNzlU:
        $code = array("status" => "2");
        goto uADU0;
        EOAwm:
        die(json_encode($code));
        goto CvAAY;
        CvAAY:
        U10Xl:
        goto Y7bNy;
        uADU0:
        die(json_encode($code));
        goto MHc3S;
        P4FH2:
        global $_W, $_GPC;
        goto UhOmv;
        h7__2:
        die(json_encode($code));
        goto zTcJS;
        gBtJV:
        fp_JQ:
        goto vzIVi;
        UhOmv:
        $oid = $_GPC["oid"];
        goto JJZy_;
        MHc3S:
        goto Qu8hu;
        goto gBtJV;
        Y7bNy:
    }
    public function doPageSendMessage()
    {
//         goto tZ9TR;
//         tZ9TR:
//         $formid = $this->gpc["formid"];
//         goto ND9sJ;
//         MJJ5p:
//         $msg = $sendmsg->sendSms($config, $o["details"]);
//         goto FSDOx;
//         QhKBC:
//         $sql = "SELECT s.sms_note,s.sms_config,i.msg_templateid,i.openid,i.msg_roof,i.admin_phone,i.address FROM " . tablename("mii_ang_setting") . " s LEFT JOIN " . tablename("mii_ang_info") . " i ON s.uniacid= i.uniacid WHERE s.uniacid=:uniacid";
//         goto D7fgX;
//         RTGfn:
//         $o = pdo_get("mii_ang_order", array("uniacid" => $this->uniacid, "oid" => $oid), array("details", "orderid"));
//         goto WTsic;
//         D7fgX:
//         $config = pdo_fetch($sql, array(":uniacid" => $this->uniacid));
//         goto pMwOs;
//         s2Kb_:
//         $openid = @json_decode($admin_openid, true);
//         goto PIPEO;
//         dOLaO:
//         mg8bd:
//         goto XfFh4;
//         PIPEO:
//         $Oogt_ = !is_array($openid);
//         goto G8SN8;
//         XfFh4:
//         $app_token = $this->App_getToken();
//         goto QbxLP;
//         mZVks:
//         $msg_roof = $config["msg_roof"];
//         goto SczF1;
//         SLfi4:
//         $resdata = $sendmsg->sendTplmessage($this->openid, $app_token, $config["msg_templateid"], $senddata, "mii_ang/pages/personal/index", $formid);
//         goto s2Kb_;
//         SczF1:
//         $sendmsg = m("message");
//         goto rNnoE;
//         PgJqR:
//         foreach ($openid as $key => $v) {
//             $sendmsg->admin_msg($v, $de, $msg_roof == "1" ? $mp_token : $app_token);
//             g9Ygc:
//         }
//         goto hB19R;
//         FSDOx:
//         $sendmsg->sendmsg($config, $o["details"]);
//         goto dOLaO;
//         rNnoE:
//         $n1a1B = !($config["sms_note"] == "1");
//         goto UtmNU;
//         G8SN8:
//         if ($Oogt_) {
//             goto N2Yqy;
//         }
//         goto PgJqR;
//         EBOdP:
//         $senddata = array("keyword1" => array("value" => $de["uname"], "color" => "#173177"), "keyword2" => array("value" => $de["goodsname"], "color" => "#173177"), "keyword3" => array("value" => date("Y/m/d H:i", $de["starttime"]) . "-" . date("H:i", $de["endtime"]), "color" => "#173177"), "keyword4" => array("value" => $o["orderid"], "color" => "#173177"), "keyword5" => array("value" => $de["techname"], "color" => "#173177"), "keyword6" => array("value" => $config["address"], "color" => "#173177"), "keyword7" => array("value" => "您的预约订单号为 " . $o["orderid"] . " 请在 " . date("Y-m-d H:i", $de["starttime"]) . " 之前到达本店。", "color" => "#173177"));
//         goto SLfi4;
//         WTsic:
//         $de = @json_decode($o["details"], true);
//         goto mZVks;
//         H_2Ew:
//         return json_encode($msg);
//         goto JRRYP;
//         pMwOs:
//         $admin_openid = $config["openid"];
//         goto RTGfn;
//         hB19R:
//         lmHh1:
//         goto EsDAK;
//         UtmNU:
//         if ($n1a1B) {
//             goto mg8bd;
//         }
//         goto MJJ5p;
//         QbxLP:
//         $mp_token = $this->getToken();
//         goto EBOdP;
//         ND9sJ:
//         $oid = $this->gpc["oid"];
//         goto QhKBC;
//         EsDAK:
//         N2Yqy:
//         goto H_2Ew;
//         JRRYP:


        $formid = $this->gpc["formid"];
        $oid = $this->gpc["oid"];
        $sql = "SELECT s.sms_note,s.sms_config,i.msg_templateid,i.openid,i.msg_roof,i.admin_phone,i.address FROM " . tablename("mii_ang_setting") . " s LEFT JOIN " . tablename("mii_ang_info") . " i ON s.uniacid= i.uniacid WHERE s.uniacid=:uniacid";
        $config = pdo_fetch($sql, array(":uniacid" => $this->uniacid));
        $admin_openid = $config["openid"];
        $o = pdo_get("mii_ang_order", array("uniacid" => $this->uniacid, "oid" => $oid), array("details", "orderid"));
        $de = @json_decode($o["details"], true);
        $msg_roof = $config["msg_roof"];
        $sendmsg = m("message");
        $n1a1B = !($config["sms_note"] == "1");
        if ($n1a1B) {
            $app_token = $this->App_getToken();
            $mp_token = $this->getToken();
            $senddata = array("keyword1" => array("value" => $de["uname"], "color" => "#173177"), "keyword2" => array("value" => $de["goodsname"], "color" => "#173177"), "keyword3" => array("value" => date("Y/m/d H:i", $de["starttime"]) . "-" . date("H:i", $de["endtime"]), "color" => "#173177"), "keyword4" => array("value" => $o["orderid"], "color" => "#173177"), "keyword5" => array("value" => $de["techname"], "color" => "#173177"), "keyword6" => array("value" => $config["address"], "color" => "#173177"), "keyword7" => array("value" => "您的预约订单号为 " . $o["orderid"] . " 请在 " . date("Y-m-d H:i", $de["starttime"]) . " 之前到达本店。", "color" => "#173177"));
            $resdata = $sendmsg->sendTplmessage($this->openid, $app_token, $config["msg_templateid"], $senddata, "mii_ang/pages/personal/index", $formid);
            $openid = @json_decode($admin_openid, true);
            $Oogt_ = !is_array($openid);
            if ($Oogt_) {
                return json_encode($msg);
            }
        }
        $msg = $sendmsg->sendSms($config, $o["details"]);
        $sendmsg->sendmsg($config, $o["details"]);
        $app_token = $this->App_getToken();
        $mp_token = $this->getToken();
        $senddata = array("keyword1" => array("value" => $de["uname"], "color" => "#173177"), "keyword2" => array("value" => $de["goodsname"], "color" => "#173177"), "keyword3" => array("value" => date("Y/m/d H:i", $de["starttime"]) . "-" . date("H:i", $de["endtime"]), "color" => "#173177"), "keyword4" => array("value" => $o["orderid"], "color" => "#173177"), "keyword5" => array("value" => $de["techname"], "color" => "#173177"), "keyword6" => array("value" => $config["address"], "color" => "#173177"), "keyword7" => array("value" => "您的预约订单号为 " . $o["orderid"] . " 请在 " . date("Y-m-d H:i", $de["starttime"]) . " 之前到达本店。", "color" => "#173177"));
        $resdata = $sendmsg->sendTplmessage($this->openid, $app_token, $config["msg_templateid"], $senddata, "mii_ang/pages/personal/index", $formid);
        $openid = @json_decode($admin_openid, true);
        $Oogt_ = !is_array($openid);
        if ($Oogt_) {
            return json_encode($msg);
        }
        foreach ($openid as $key => $v) {
            $sendmsg->admin_msg($v, $de, $msg_roof == "1" ? $mp_token : $app_token);
            //g9Ygc:
        }
    }
    public function doPageUser()
    {
        goto UMB75;
        xY4Jc:
        $user = pdo_get("mii_ang_user", array("uPassword" => $res["openid"]), array("uName", "uPhone"));
        goto NLMZr;
        GiyRr:
        $res = $this->Getopenids($code);
        goto xY4Jc;
        oiXLe:
        $code = $_GPC["code"];
        goto GiyRr;
        UMB75:
        global $_W, $_GPC;
        goto oiXLe;
        xd5JV:
        return $resdata;
        goto NrIS5;
        NLMZr:
        $resdata = json_encode(array("openid" => $res["openid"], "toopenid" => $res["toopenid"], "uName" => $user["uName"], "uPhone" => $user["uPhone"]));
        goto xd5JV;
        NrIS5:
    }
    public function User($code)
    {
        $openid = $this->GetUserInfo($code);
        return $openid;
    }
    public function GetUserInfo($code)
    {
        goto MJo_b;
        IF4js:
        $code = $code;
        goto hPjom;
        bjo8f:
        $curl = curl_init();
        goto YvfFE;
        a1L8b:
        $user = pdo_get("mii_ang_user", array("uPassword" => md5($userdata["openid"])), array("uid"));
        goto p5tvP;
        p5tvP:
        $TQTex = !(!$user && !empty($code));
        goto V_ns7;
        wd3Eg:
        $userdata = json_decode($res, true);
        goto a1L8b;
        BGJ_a:
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        goto FQGwA;
        ZPtUb:
        return md5($userdata["openid"]);
        goto SeF4k;
        O9aFm:
        curl_setopt($curl, CURLOPT_HEADER, flase);
        goto BGJ_a;
        YvfFE:
        curl_setopt($curl, CURLOPT_URL, $url);
        goto O9aFm;
        lDedB:
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        goto StZrt;
        QO1x5:
        $ins = pdo_insert("mii_ang_user", array("uniacid" => $_W["uniacid"], "uPassword" => md5($userdata["openid"]), "openid" => $userdata["openid"]));
        goto osb3k;
        H9csI:
        $secret = $_W["account"]["secret"];
        goto zo18c;
        zo18c:
        $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $secret . "&js_code=" . $code . "&grant_type=authorization_code";
        goto bjo8f;
        hPjom:
        $appid = $_W["account"]["key"];
        goto H9csI;
        Sh_HQ:
        curl_close($curl);
        goto wd3Eg;
        osb3k:
        IzSLU:
        goto ZPtUb;
        MJo_b:
        global $_W, $_GPC;
        goto IF4js;
        FQGwA:
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        goto GXt6C;
        V_ns7:
        if ($TQTex) {
            goto IzSLU;
        }
        goto QO1x5;
        StZrt:
        $res = curl_exec($curl);
        goto Sh_HQ;
        GXt6C:
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        goto lDedB;
        SeF4k:
    }
    public function doPageUseropenid()
    {
        goto k5b_B;
        H2ZdN:
        return $openid;
        goto XgiXJ;
        k5b_B:
        global $_W, $_GPC;
        goto Fjsmh;
        eJYRm:
        $openid = $this->Getopenid($code);
        goto H2ZdN;
        Fjsmh:
        $code = $_GPC["code"];
        goto eJYRm;
        XgiXJ:
    }
    public function Getopenid($code)
    {
        goto n0uzp;
        aAU8C:
        XMD6J:
        goto WK1P0;
        hC0Wh:
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        goto lm0Ip;
        cN112:
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        goto hC0Wh;
        JCmYP:
        if ($TQTex) {
            goto XMD6J;
        }
        goto Maeeo;
        lm0Ip:
        $res = curl_exec($curl);
        goto a1N0O;
        oOT6J:
        curl_setopt($curl, CURLOPT_HEADER, flase);
        goto RnofN;
        HDqgI:
        curl_setopt($curl, CURLOPT_URL, $url);
        goto oOT6J;
        a1N0O:
        curl_close($curl);
        goto q60Zb;
        RnofN:
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        goto LS27D;
        j4GBE:
        $appid = $_W["account"]["key"];
        goto eu5Od;
        sqZL4:
        $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $secret . "&js_code=" . $code . "&grant_type=authorization_code";
        goto zakxV;
        q60Zb:
        $userdata = json_decode($res, true);
        goto n2frb;
        UGFbj:
        $code = $code;
        goto j4GBE;
        oIihE:
        $TQTex = !(!$user && !empty($code));
        goto JCmYP;
        n0uzp:
        global $_W, $_GPC;
        goto UGFbj;
        Maeeo:
        $ins = pdo_insert("mii_ang_user", array("uniacid" => $_W["uniacid"], "uPassword" => md5($userdata["openid"]), "openid" => $userdata["openid"]));
        goto aAU8C;
        WK1P0:
        return $userdata["openid"];
        goto wHw8R;
        n2frb:
        $user = pdo_get("mii_ang_user", array("uPassword" => md5($userdata["openid"])), array("uid"));
        goto oIihE;
        zakxV:
        $curl = curl_init();
        goto HDqgI;
        LS27D:
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        goto cN112;
        eu5Od:
        $secret = $_W["account"]["secret"];
        goto sqZL4;
        wHw8R:
    }
    public function Getopenids($code)
    {
        goto n23AH;
        MvtBp:
        curl_close($curl);
        goto sxRyp;
        yAAY6:
        curl_setopt($curl, CURLOPT_URL, $url);
        goto v8RIl;
        N1whH:
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        goto ZYhVW;
        sxRyp:
        $userdata = json_decode($res, true);
        goto EX37_;
        g4ePk:
        $code = $code;
        goto tUWe6;
        L9ZmW:
        NUk4b:
        goto aHTpX;
        lScJd:
        if ($TQTex) {
            goto NUk4b;
        }
        goto mI7VY;
        tUWe6:
        $appid = $_W["account"]["key"];
        goto MKWbp;
        n23AH:
        global $_W, $_GPC;
        goto g4ePk;
        EX37_:
        $user = pdo_get("mii_ang_user", array("uPassword" => md5($userdata["openid"])), array("uid"));
        goto VcGPd;
        aHTpX:
        $toopenid = $userdata["openid"];
        goto xdc46;
        mI7VY:
        $ins = pdo_insert("mii_ang_user", array("uniacid" => $_W["uniacid"], "uPassword" => md5($userdata["openid"]), "openid" => $userdata["openid"]));
        goto L9ZmW;
        tKdS4:
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        goto N1whH;
        NNV31:
        $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $secret . "&js_code=" . $code . "&grant_type=authorization_code";
        goto VRxQA;
        xdc46:
        $openid = md5($userdata["openid"]);
        goto snEKq;
        rUx_4:
        return $resdata;
        goto qwK8o;
        K5FiI:
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        goto tKdS4;
        ZYhVW:
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        goto oZ0uI;
        MKWbp:
        $secret = $_W["account"]["secret"];
        goto NNV31;
        oZ0uI:
        $res = curl_exec($curl);
        goto MvtBp;
        snEKq:
        $resdata = array("openid" => $openid, "toopenid" => $toopenid);
        goto rUx_4;
        VRxQA:
        $curl = curl_init();
        goto yAAY6;
        VcGPd:
        $TQTex = !(!$user && !empty($code));
        goto lScJd;
        v8RIl:
        curl_setopt($curl, CURLOPT_HEADER, flase);
        goto K5FiI;
        qwK8o:
    }
    public function doPagegetmybook()
    {
        goto uKgFV;
        uKgFV:
        global $_W, $_GPC;
        goto KgUrx;
        t_u5Z:
        $book = array("title" => $mybookPage["title"] == '' ? "我的预约" : $mybookPage["title"], "book" => $booklists, "uid" => $uid, "show" => $show, "empty" => $empty);
        goto hroXz;
        Z790s:
        goto F7S7d;
        goto SgMUh;
        tFvc8:
        if ($pRHId) {
            goto l2cJ8;
        }
        goto QwJlz;
        KogqG:
        $page = $_GPC["page"];
        goto hm9eg;
        hm9eg:
        $pindex = max(1, intval($page));
        goto vZHqh;
        DG45j:
        $uid = $this->uid;
        goto yMKFh;
        Sqa0f:
        $empty = "false";
        goto abiF1;
        hroXz:
        return json_encode($book);
        goto DmgWs;
        KgUrx:
        @(include MODULE_ROOT . "/public/pageinfo/mybookPage." . $_W["uniacid"] . ".php");
        goto DG45j;
        ktFjk:
        foreach ($booklist as $key => $b) {
            goto eTbUz;
            eTbUz:
            $details = json_decode($b["details"], true);
            goto WdMGd;
            WdMGd:
            $booklists[] = array("oid" => $b["oid"], "booktime" => date("Y/m/d H:i", $details["starttime"]) . "-" . date("H:i", $details["endtime"]), "goodsname" => $details["goodsname"], "order_type" => $b["order_type"]);
            goto zIQ2k;
            zIQ2k:
            iR5Fb:
            goto tLaoN;
            tLaoN:
        }
        goto Mb9ec;
        F51Ns:
        $booklist = pdo_fetchall($sql);
        goto JlqGx;
        nkzaq:
        $show = "true";
        goto Z790s;
        BRO37:
        $sql = "SELECT `oid`,details,order_type FROM" . tablename("mii_ang_order") . "WHERE uid={$uid} ORDER BY addtime  DESC LIMIT " . ($pindex - 1) * $psize . "," . $psize;
        goto F51Ns;
        gWYpL:
        VVrwz:
        goto t_u5Z;
        T9xZL:
        $total = pdo_fetchcolumn($countSql);
        goto JccI3;
        Mb9ec:
        KhyQF:
        goto qIa6d;
        JlqGx:
        $countSql = "SELECT COUNT(*)FROM " . tablename("mii_ang_order") . "WHERE uid ={$uid} ORDER BY addtime DESC";
        goto T9xZL;
        SpIi0:
        F7S7d:
        goto eTjL4;
        vZHqh:
        $psize = 4;
        goto BRO37;
        eTjL4:
        if ($page == "0" && empty($booklist)) {
            goto UecnY;
        }
        goto Sqa0f;
        JccI3:
        $pager = pagination($total, $pindex, $psize, $url = '', $context = array("before" => 1, "after" => 1, "ajaxcallback" => '', "callbackfuncname" => ''));
        goto aZUAh;
        R4TVC:
        $pagenum = ceil($total / $psize);
        goto x1cnF;
        yMKFh:
        $openid = $this->openid;
        goto KogqG;
        x1cnF:
        if ($page == $pagenum || empty($booklist)) {
            goto BI6fM;
        }
        goto nkzaq;
        abiF1:
        goto VVrwz;
        goto HZSIw;
        qqFEZ:
        $show = "false";
        goto SpIi0;
        aZUAh:
        $pRHId = !$booklist;
        goto tFvc8;
        SgMUh:
        BI6fM:
        goto qqFEZ;
        QwJlz:
        $booklists = array();
        goto ktFjk;
        PYTSs:
        $empty = "true";
        goto gWYpL;
        qIa6d:
        l2cJ8:
        goto R4TVC;
        HZSIw:
        UecnY:
        goto PYTSs;
        DmgWs:
    }
    public function doPagecancelbook()
    {
        goto rdwpv;
        dvEBS:
        $del = pdo_delete("mii_ang_order", array("oid" => $oid, "uniacid" => $this->w["uniacid"]));
        goto Iln5h;
        fijCc:
        die(json_encode($code));
        goto Px8mZ;
        Iln5h:
        if ($del) {
            goto G8xYj;
        }
        goto Icp3W;
        Px8mZ:
        goto EcV8n;
        goto JY64V;
        f8Q58:
        die(json_encode($code));
        goto pVR9t;
        rdwpv:
        $oid = $this->gpc["oid"];
        goto dvEBS;
        JY64V:
        G8xYj:
        goto uoLGd;
        uoLGd:
        $code = array("status" => "1", "msg" => "取消成功");
        goto f8Q58;
        pVR9t:
        EcV8n:
        goto Ipg33;
        Icp3W:
        $code = array("status" => "2", "msg" => "取消失败");
        goto fijCc;
        Ipg33:
    }
    public function doPagePersonal()
    {
        goto KcNOj;
        rnn91:
        $data = array("uniacid" => $_W["uniacid"], "uPassword" => $uPassword, "openid" => $openids["toopenid"]);
        goto UrKyJ;
        nQd4R:
        goto SxYdm;
        goto pRYUA;
        tUihJ:
        $uid = $user["uid"];
        goto nQd4R;
        AkE6A:
        JsinO:
        goto ryMeO;
        GGeV7:
        Ra9rM:
        goto Osjv7;
        PcITC:
        $code = $_GPC["code"];
        goto L6_YB;
        cjNnq:
        SxYdm:
        goto SRvXu;
        L6_YB:
        $openids = $this->Getopenids($code);
        goto isZpC;
        XZQFn:
        if (empty($user["uid"])) {
            goto J6pLH;
        }
        goto tUihJ;
        Osjv7:
        $ishide = 1;
        goto AkE6A;
        bHv3i:
        $booknum = pdo_fetchcolumn("SELECT COUNT(*) FROM" . tablename("mii_ang_order") . "WHERE uid={$uid}");
        goto Ggkj1;
        VEu6T:
        $ishide = 0;
        goto xMpnG;
        ryMeO:
        $info = pdo_get("mii_ang_info", array("uniacid" => $_W["uniacid"]), array("copyright", "phone"));
        goto bHv3i;
        c8DcR:
        return $personal_res;
        goto Di3F7;
        HO9AL:
        $uid = pdo_insertid();
        goto cjNnq;
        KcNOj:
        global $_W, $_GPC;
        goto r8kNe;
        F__rO:
        $user = pdo_get("mii_ang_user", array("uPassword" => $uPassword), array("uid", "uName", "uPhone"));
        goto XZQFn;
        UrKyJ:
        $ins = pdo_insert("mii_ang_user", $data);
        goto HO9AL;
        xMpnG:
        goto JsinO;
        goto GGeV7;
        Ggkj1:
        $cardnum = pdo_fetchcolumn("SELECT COUNT(*) FROM" . tablename("mii_ang_ucard") . "WHERE uid={$uid} AND uniacid={$_W["uniacid"]} AND `use`=-1 AND `roof`='MII' ");
        goto bezgT;
        r8kNe:
        @(include MODULE_ROOT . "/public/pageinfo/personalPage." . $_W["uniacid"] . ".php");
        goto PcITC;
        SRvXu:
        if (empty($user["uName"]) || empty($user["uPhone"])) {
            goto Ra9rM;
        }
        goto VEu6T;
        isZpC:
        $uPassword = $openids["openid"];
        goto F__rO;
        bezgT:
        $personal_res = json_encode(array("uid" => $uid, "title" => $personalPage["title"] == '' ? "个人中心" : $personalPage["title"], "booknum" => $booknum, "cardnum" => $cardnum, "copyright" => $info["copyright"], "phone" => $info["phone"], "uName" => $user["uName"], "uPhone" => $user["uPhone"], "ishide" => $ishide, "w" => $_W));
        goto c8DcR;
        pRYUA:
        J6pLH:
        goto rnn91;
        Di3F7:
    }
    public function doPageGetcard()
    {
        goto FuaWC;
        FuaWC:
        global $_W, $_GPC;
        goto Smwep;
        yeCGM:
        return $code;
        goto bM7PM;
        YcPHf:
        $openid = $_GPC["openid"];
        goto fyWoZ;
        iKn34:
        $code = json_encode(array("msg" => "换取成功", "cardArray" => $cardArry));
        goto yeCGM;
        KAYvP:
        $cardArry = $this->getCard($cardid, $openid);
        goto iKn34;
        fyWoZ:
        $cardid = $_GPC["card_id"];
        goto KAYvP;
        Pl2Lh:
        load()->func("communication");
        goto YcPHf;
        Smwep:
        load()->classs("weixin.account");
        goto Pl2Lh;
        bM7PM:
    }
    public function opencard()
    {
        goto jss2m;
        e8jZc:
        return $resdata;
        goto fhDAo;
        jss2m:
        global $_W, $_GPC;
        goto gj5eC;
        pSUoy:
        $resdata = activity_coupon_grant("peAza1Ivljkwy_u_gs0jPLmrLVNM", $_W["openid"]);
        goto e8jZc;
        gj5eC:
        load()->model("activity");
        goto pSUoy;
        fhDAo:
    }
    public function doPageUpcard()
    {
        goto sbAeF;
        aDaTd:
        $cardid = $_GPC["card_id"];
        goto SNqKq;
        rBwYy:
        $res = ihttp_post($url, $post);
        goto pxw5N;
        e2V4D:
        $post = "{\r\n                    \"card_id\":\"" . $cardid . "\",\r\n                    \"" . $card_type . "\": {\r\n                            \"base_info\": {\r\n                                    \"custom_url_name\": \"进入小程序\",\r\n                                    \"custom_url\": \"http://www.qq.com\",\r\n                                    \"custom_app_brand_user_name\": \"" . $_W["uniaccount"]["original"] . "@app\",\r\n                                    \"custom_app_brand_pass\":\"mii_ang/pages/index/index\",\r\n                                    \"custom_url_sub_title\": \"进入小程序\",\r\n                                    \"promotion_url_name\": \"小程序\",\r\n                                    \"promotion_url\": \"http://www.qq.com\",\r\n                                    \"promotion_app_brand_user_name\": \"" . $_W["uniaccount"]["original"] . "@app\",\r\n                                    \"promotion_app_brand_pass\":\"mii_ang/pages/index/index\"\r\n                            }\r\n\t                }\r\n\t    }";
        goto onw0L;
        SNqKq:
        $card_type = $_GPC["card_type"];
        goto V1nNg;
        b2drk:
        load()->func("communication");
        goto aDaTd;
        pxw5N:
        return $res["errmsg"];
        goto ijTCy;
        V1nNg:
        $access_token = $this->getToken();
        goto e2V4D;
        sbAeF:
        global $_W, $_GPC;
        goto od3zg;
        od3zg:
        load()->classs("weixin.account");
        goto b2drk;
        onw0L:
        $url = "https://api.weixin.qq.com/card/update?access_token={$access_token}";
        goto rBwYy;
        ijTCy:
    }
    public function doPageUsercard()
    {
        goto MSpdQ;
        FVlqE:
        return $data;
        goto vQHEV;
        f3dQq:
        load()->func("communication");
        goto cw2X8;
        MSpdQ:
        global $_GPC;
        goto UsB7n;
        WVKPB:
        $res = ihttp_post($url, $post);
        goto fanSS;
        H2K8c:
        $post = "{\"openid\":\"" . $openid . "\"}";
        goto igSG2;
        fanSS:
        $data = $res["content"];
        goto FVlqE;
        UsB7n:
        load()->classs("weixin.account");
        goto f3dQq;
        O3bHJ:
        $access_token = $this->getToken();
        goto H2K8c;
        igSG2:
        $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=" . $access_token;
        goto WVKPB;
        cw2X8:
        $openid = $_GPC["openid"];
        goto O3bHJ;
        vQHEV:
    }
    public function doPageGetcardlist()
    {
        goto Rh_Iz;
        GjFsg:
        @(include MODULE_ROOT . "/public/pageinfo/cardPage." . $_W["uniacid"] . ".php");
        goto OFn97;
        SQdiQ:
        j4w7H:
        goto aD869;
        jPazG:
        foreach ($card as $key => $v) {
            goto dpRVF;
            nGdYp:
            $cardList[] = $cardArr;
            goto f5tWX;
            W0mEN:
            $cardArr["card_on"] = $code_on;
            goto NsOvY;
            D3rrS:
            $cardArr["title"] = $v["title"];
            goto vOahp;
            NsOvY:
            $cardArr["card_info"] = "库存:" . $v["quantity"];
            goto nGdYp;
            M1f0p:
            $code_on = $code->code_on();
            goto BtH23;
            PY_Yi:
            $cardArr["card_type"] = $v["card_type"];
            goto QfbI0;
            BtH23:
            $cardArr["id"] = $v["id"];
            goto cLaTj;
            dpRVF:
            $code = new Ucode(random(5, true), substr($v["card_type"], 0, 2));
            goto M1f0p;
            f5tWX:
            mk4D0:
            goto hleSC;
            QfbI0:
            $cardArr["card_id"] = $v["card_id"];
            goto SNyQv;
            cLaTj:
            $cardArr["roof"] = $v["roof"];
            goto PY_Yi;
            bmyol:
            $cardArr["date"] = $v["time_type"] == "DATE_TYPE_FIX_TIME_RANGE" ? date("Y.m.d", $v["starttime"]) . " - " . date("Y.m.d", $v["endtime"]) : "不限";
            goto W0mEN;
            vOahp:
            $cardArr["quantity"] = $v["quantity"];
            goto bmyol;
            SNyQv:
            $cardArr["bg_color"] = $v["bg_color"];
            goto D3rrS;
            hleSC:
        }
        goto ouWby;
        qRnpc:
        return json_encode($code);
        goto B7tao;
        zygoF:
        $card = pdo_fetchall($sql, array(":uniacid" => $_W["uniacid"], ":status" => "1"));
        goto IxcWe;
        Rh_Iz:
        global $_W;
        goto GjFsg;
        ouWby:
        t8NpF:
        goto nqMjU;
        sQHKC:
        TQuwW:
        goto xM6Hj;
        aD869:
        $cardList = array();
        goto jPazG;
        IxcWe:
        if (!empty($card)) {
            goto j4w7H;
        }
        goto iEkIb;
        lNE4N:
        return json_encode($code);
        goto sQHKC;
        OFn97:
        $sql = "SELECT id,roof,card_type,card_id,bg_color,title,date_info,time_type,quantity,starttime,endtime FROM " . tablename("mii_ang_card") . " WHERE uniacid=:uniacid AND status=:status ORDER BY addtime DESC";
        goto zygoF;
        nqMjU:
        $code = array("erron" => 1, "cardlist" => $cardList, "nocard" => "0", "title" => $cardPage["title"] == '' ? "卡券中心" : $cardPage["title"]);
        goto lNE4N;
        iEkIb:
        $code = array("erron" => 2, "cardlist" => $card, "nocard" => "1", "title" => $cardPage["title"] == '' ? "卡券中心" : $cardPage["title"]);
        goto qRnpc;
        B7tao:
        goto TQuwW;
        goto SQdiQ;
        xM6Hj:
    }
    public function doPageGetmycardlist()
    {
        goto M884I;
        pkGFT:
        x3xLJ:
        goto XrVsc;
        fpFui:
        return json_encode($code);
        goto pkGFT;
        Z67Fh:
        IvKBr:
        goto kgYo8;
        hEYm6:
        @(include MODULE_ROOT . "/public/pageinfo/cardPage." . $_W["uniacid"] . ".php");
        goto mxKJ5;
        M884I:
        global $_W;
        goto hEYm6;
        rBySR:
        goto x3xLJ;
        goto nm12j;
        kgYo8:
        $code = array("erron" => 1, "cardlist" => $cardList, "nocard" => "0", "title" => $cardPage["title"] == '' ? "卡券中心" : $cardPage["title"]);
        goto fpFui;
        mxKJ5:
        $sql = "SELECT uc.cid,uc.card_on,uc.use,c.roof,c.card_type,c.card_id,c.bg_color,c.title,c.starttime,c.endtime,c.card_type,c.time_type FROM " . tablename("mii_ang_user") . " u LEFT JOIN " . tablename("mii_ang_ucard") . " uc ON u.uid = uc.uid LEFT JOIN " . tablename("mii_ang_card") . " c ON uc.cid = c.id WHERE u.uniacid=:uniacid AND u.uPassword=:uPassword AND uc.use=:use AND c.roof=:roof ORDER BY uc.addtime DESC";
        goto T1jrR;
        ROaOw:
        $code = array("erron" => 2, "cardlist" => $card, "nocard" => "1", "title" => $cardPage["title"] == '' ? "卡券中心" : $cardPage["title"]);
        goto g7Zr0;
        T1jrR:
        $card = pdo_fetchall($sql, array(":uniacid" => $_W["uniacid"], ":uPassword" => md5($_W["openid"]), ":use" => "-1", ":roof" => "MII"));
        goto yK5TL;
        g7Zr0:
        return json_encode($code);
        goto rBySR;
        nm12j:
        CQF7J:
        goto vQyct;
        NfHNV:
        foreach ($card as $key => $v) {
            goto RFsvs;
            O5Fgb:
            $cardArr["card_info"] = $v["use"] == "-1" ? "待使用" : "已使用";
            goto DHPlQ;
            DHPlQ:
            $cardList[] = $cardArr;
            goto Uyzf2;
            wnV3q:
            $cardArr["roof"] = $v["roof"];
            goto k_Qy4;
            v9dFq:
            $cardArr["title"] = $v["title"];
            goto qFX9Q;
            mop1e:
            $cardArr["card_id"] = $v["card_id"];
            goto Tf4Wj;
            Tf4Wj:
            $cardArr["bg_color"] = $v["bg_color"];
            goto v9dFq;
            RFsvs:
            $cardArr["id"] = $v["cid"];
            goto wnV3q;
            Lkcsq:
            $cardArr["card_on"] = $v["card_on"];
            goto O5Fgb;
            k_Qy4:
            $cardArr["card_type"] = $v["card_type"];
            goto mop1e;
            qFX9Q:
            $cardArr["date"] = $v["time_type"] == "DATE_TYPE_FIX_TIME_RANGE" ? date("Y.m.d", $v["starttime"]) . " - " . date("Y.m.d", $v["endtime"]) : "不限";
            goto Lkcsq;
            Uyzf2:
            a7UOC:
            goto wDGji;
            wDGji:
        }
        goto Z67Fh;
        vQyct:
        $cardList = array();
        goto NfHNV;
        yK5TL:
        if (!empty($card) && is_array($card)) {
            goto CQF7J;
        }
        goto ROaOw;
        XrVsc:
    }
    public function doPageAddcard()
    {
        goto kU2NN;
        u53EL:
        $cardid = $_GPC["card_id"];
        goto sIm75;
        kU2NN:
        global $_W, $_GPC;
        goto CD26O;
        CD26O:
        load()->classs("weixin.account");
        goto Db8vj;
        Db8vj:
        load()->func("communication");
        goto u53EL;
        fs_td:
        $code = json_encode(array("msg" => "换取成功", "cardArray" => $cardArry));
        goto y89sE;
        sIm75:
        $cardArry = $this->getCard($cardid, $_W["openid"]);
        goto fs_td;
        y89sE:
        return $code;
        goto CRL0q;
        CRL0q:
    }
    public function doPageGetusecard()
    {
        goto wB7Eu;
        DtjJ9:
        jvoON:
        goto mrPf8;
        adUyS:
        return json_encode(array("status" => "2", "msg" => "没有可供使用的优惠券"));
        goto K4NCD;
        GxOl3:
        goto jvoON;
        goto SayWr;
        mrPf8:
        if (!empty($cardList)) {
            goto s0BIm;
        }
        goto adUyS;
        wB7Eu:
        global $_W, $_GPC;
        goto LD1S1;
        aMACO:
        $cardList = array();
        goto f5Ax6;
        K4NCD:
        goto Eb23E;
        goto oDjOC;
        f5Ax6:
        foreach ($card as $key => $v) {
            goto aCdXl;
            aCdXl:
            $cardArr["id"] = $v["id"];
            goto TLMMp;
            h1v8n:
            $cardArr["date"] = $v["time_type"] == "DATE_TYPE_FIX_TIME_RANGE" ? date("Y.m.d", $v["starttime"]) . " - " . date("Y.m.d", $v["endtime"]) : "不限";
            goto M55oH;
            M55oH:
            $cardArr["card_info"] = $v["use"] == "-1" ? "待使用" : "已使用";
            goto b_Wez;
            f6774:
            $cardArr["card_type"] = $v["card_type"];
            goto Jy1wQ;
            Jy1wQ:
            $cardArr["bg_color"] = $v["bg_color"];
            goto DvV7H;
            G6P8d:
            Za4NR:
            goto IDhi4;
            TLMMp:
            $cardArr["card_on"] = $v["card_on"];
            goto f6774;
            DvV7H:
            $cardArr["title"] = $v["title"];
            goto h1v8n;
            b_Wez:
            $cardList[] = $cardArr;
            goto G6P8d;
            IDhi4:
        }
        goto Oz4LY;
        hVg2S:
        $card = pdo_fetchall($sql, array(":uniacid" => $_W["uniacid"], ":uPassword" => md5($_W["openid"]), ":use" => "-1", ":condition" => $price, ":roof" => "MII", ":endtime" => $_W["timestamp"]));
        goto LViWv;
        amdyN:
        $cardList = array();
        goto GxOl3;
        SayWr:
        dJYuh:
        goto aMACO;
        LViWv:
        if (!empty($card)) {
            goto dJYuh;
        }
        goto amdyN;
        flq2U:
        $sql = "SELECT uc.card_on,uc.use,c.id,c.card_type,c.bg_color,c.title,c.starttime,c.endtime,c.time_type FROM " . tablename("mii_ang_user") . " u LEFT JOIN " . tablename("mii_ang_ucard") . " uc ON u.uid=uc.uid LEFT JOIN " . tablename("mii_ang_card") . " c ON uc.cid=c.id WHERE u.uniacid = :uniacid AND u.uPassword = :uPassword AND uc.use=:use AND c.condition <= :condition AND c.roof = :roof AND c.endtime >= :endtime ";
        goto hVg2S;
        oDjOC:
        s0BIm:
        goto f9rPp;
        f9rPp:
        return json_encode(array("status" => "1", "cardList" => $cardList));
        goto u345l;
        Oz4LY:
        D6Kr5:
        goto DtjJ9;
        u345l:
        Eb23E:
        goto IuJV5;
        LD1S1:
        $price = intval($_GPC["price"]);
        goto flq2U;
        IuJV5:
    }
    public function doPageUsecard()
    {
        goto qbgGF;
        Ko0Er:
        goto Yd321;
        goto rHQi8;
        G6jpJ:
        goto TxAy7;
        goto Afp3d;
        VQOml:
        goto Yd321;
        goto EwzLm;
        Afp3d:
        bsOKy:
        goto lDFyv;
        DKIXF:
        return json_encode(array("status" => "1", "price" => $p));
        goto jzEsD;
        CPUIh:
        $card = pdo_get("mii_ang_card", array("id" => $cid), array("card_type", "condition", "minus", "discount"));
        goto E4zHR;
        kVXXc:
        if ($card["card_type"] == "DISCOUNT" && $price >= $card["condition"]) {
            goto Vs4UW;
        }
        goto rlqFk;
        hLp9v:
        goto X83IE;
        goto gVKeC;
        zPO8V:
        if ($p >= 0) {
            goto r7MXX;
        }
        goto Bm9kA;
        rlqFk:
        return json_encode(array("status" => "2", "msg" => "优惠券设置异常，请联系管理员"));
        goto Ko0Er;
        raTFu:
        if ($p >= 0) {
            goto bsOKy;
        }
        goto tbusW;
        EwzLm:
        Vs4UW:
        goto zGE96;
        lXFS8:
        $price = floatval($_GPC["price"]);
        goto CPUIh;
        YZBRS:
        TxAy7:
        goto VQOml;
        E4zHR:
        if ($card["card_type"] == "GENERAL_COUPON" && $price >= $card["condition"]) {
            goto ytkUt;
        }
        goto kVXXc;
        lDFyv:
        return json_encode(array("status" => "1", "price" => $p));
        goto YZBRS;
        qbgGF:
        global $_W, $_GPC;
        goto jUsRM;
        Bm9kA:
        return json_encode(array("status" => "2", "msg" => "优惠券设置异常，请联系管理员"));
        goto hLp9v;
        jUsRM:
        $cid = intval($_GPC["cid"]);
        goto lXFS8;
        gVKeC:
        r7MXX:
        goto DKIXF;
        tbusW:
        return json_encode(array("status" => "2", "msg" => "优惠券设置异常，请联系管理员"));
        goto G6jpJ;
        kKm0g:
        $p = round($price - $card["minus"], 2);
        goto raTFu;
        zGE96:
        $p = round($price * ($card["discount"] / 10), 2);
        goto zPO8V;
        jzEsD:
        X83IE:
        goto iIUiM;
        rHQi8:
        ytkUt:
        goto kKm0g;
        iIUiM:
        Yd321:
        goto VfTjr;
        VfTjr:
    }
    private function usecarddata($card_id, $price)
    {
        goto pt2Q1;
        aD9B4:
        orFfb:
        goto n1O8m;
        EChC2:
        return $p;
        goto pCbQw;
        Te4CY:
        U49DJ:
        goto DKl2i;
        HqPXq:
        return $price;
        goto y08V6;
        mu_Zo:
        $price = floatval($price);
        goto mWOWy;
        pt2Q1:
        $card_id = $card_id;
        goto mu_Zo;
        y08V6:
        goto orFfb;
        goto Te4CY;
        Dk_Km:
        if ($card["card_type"] == "GENERAL_COUPON" && $price >= $card["condition"]) {
            goto VIsjW;
        }
        goto p1zFJ;
        FpviP:
        $p = round($price - $card["minus"], 2);
        goto C48QH;
        Jpk35:
        VIsjW:
        goto FpviP;
        pCbQw:
        YNEIY:
        goto rEqGE;
        dYzsn:
        Cqz2y:
        goto EChC2;
        URsvm:
        if ($p >= 0) {
            goto U49DJ;
        }
        goto HqPXq;
        n1O8m:
        x0OlH:
        goto JtCfK;
        qZfor:
        goto YNEIY;
        goto dYzsn;
        lpC8q:
        $p = round($price * ($card["discount"] / 10), 2);
        goto URsvm;
        A29jo:
        return $price;
        goto qZfor;
        xEJSC:
        wOQRq:
        goto lpC8q;
        YZuVE:
        goto x0OlH;
        goto Jpk35;
        rEqGE:
        goto x0OlH;
        goto xEJSC;
        C48QH:
        if ($p >= 0) {
            goto Cqz2y;
        }
        goto A29jo;
        mWOWy:
        $card = pdo_get("mii_ang_card", array("id" => $card_id), array("card_type", "condition", "minus", "discount"));
        goto Dk_Km;
        p1zFJ:
        if ($card["card_type"] == "DISCOUNT" && $price >= $card["condition"]) {
            goto wOQRq;
        }
        goto D9JFE;
        D9JFE:
        return $price;
        goto YZuVE;
        DKl2i:
        return $p;
        goto aD9B4;
        JtCfK:
    }
    private function cardPrice($price, $p)
    {
        return floatval($price) - floatval($p);
    }
    private function subcode($code)
    {
        goto RDyu_;
        FlA4z:
        $codes = str_replace("\\", '', $codes);
        goto sjwHg;
        q6otl:
        $codestr = $codeArr[0];
        goto W3PGI;
        ORHVN:
        $codeArr = explode(",", $codes);
        goto XyXgo;
        j3_rc:
        goto P0Yyv;
        goto r1VrK;
        W3PGI:
        $rescode = "{" . $codestr . "}";
        goto q67qE;
        XyXgo:
        if (is_array($codeArr)) {
            goto vFKoV;
        }
        goto PMcFt;
        q67qE:
        P0Yyv:
        goto m1U_A;
        r1VrK:
        vFKoV:
        goto q6otl;
        sjwHg:
        $codes = str_replace("[{", '', $codes);
        goto OYP6Y;
        RDyu_:
        $codes = str_replace("&quot;", "\"", $code);
        goto FlA4z;
        OYP6Y:
        $codes = str_replace("}]", '', $codes);
        goto C40SJ;
        C40SJ:
        $codes = trim($codes);
        goto ORHVN;
        m1U_A:
        return $rescode;
        goto hcuhA;
        PMcFt:
        $rescode = '';
        goto j3_rc;
        hcuhA:
    }
    public function doPageInsCard()
    {
        goto WDhCR;
        l9GXO:
        $ins = pdo_insert("mii_ang_user", $data);
        goto eHycf;
        aLh7K:
        $codes = $_GPC["code"];
        goto ul2rt;
        LcYFn:
        pdo_update("mii_ang_card", array("quantity -=" => "1"), array("id" => $cid));
        goto Y5U9D;
        YJ5Xn:
        $card_id = $_GPC["card_id"];
        goto q3wpv;
        chjCA:
        Zl4QG:
        goto m6MYq;
        dl6p0:
        $cid = $_GPC["iid"];
        goto oemKg;
        WDhCR:
        global $_W, $_GPC;
        goto aLh7K;
        hiSD_:
        goto Zl4QG;
        goto VD303;
        q3wpv:
        $card_type = $_GPC["card_type"];
        goto F3b1u;
        w57TT:
        return json_encode($resdata);
        goto chjCA;
        Qt6Zr:
        $resdata = array("status" => "1", "msg" => "领取卡券成功,请返回微信我的卡包查看！");
        goto w57TT;
        Ei2MP:
        return json_encode($resdata);
        goto hiSD_;
        oemKg:
        $uid = pdo_get("mii_ang_user", array("uPassword" => md5($_W["openid"])), array("uid"));
        goto FUs4Z;
        eHycf:
        $uid["uid"] = pdo_insertid();
        goto kkmvy;
        mNItz:
        $data = array("uniacid" => $_W["uniacid"], "uPassword" => md5($_W["openid"]));
        goto l9GXO;
        Nnwhi:
        $inscard = pdo_insert("mii_ang_ucard", array("uid" => $uid["uid"], "uniacid" => $_W["uniacid"], "cid" => $cid, "card_id" => $card_id, "code" => $code, "card_type" => $card_type, "card_on" => $card_on, "addtime" => $_W["timestamp"], "roof" => "WECHAT"));
        goto LcYFn;
        VD303:
        Uetce:
        goto Qt6Zr;
        zJ2PZ:
        $resdata = array("status" => "2", "msg" => "领取卡券失败");
        goto Ei2MP;
        FUs4Z:
        $Hk61S = !empty($uid["uid"]);
        goto NFUry;
        ul2rt:
        $code = $this->subcode($codes);
        goto YJ5Xn;
        F3b1u:
        $card_on = $_GPC["card_on"];
        goto dl6p0;
        Y5U9D:
        if ($inscard) {
            goto Uetce;
        }
        goto zJ2PZ;
        kkmvy:
        LM61P:
        goto Nnwhi;
        NFUry:
        if ($Hk61S) {
            goto LM61P;
        }
        goto mNItz;
        m6MYq:
    }
    public function deCardcode($code)
    {
        goto XnhHE;
        XnhHE:
        $access_token = $this->getToken();
        goto mPVnv;
        yaWHf:
        $res = ihttp_request($url, $post);
        goto Mwznt;
        dDmFA:
        $post = "{\r\n\t\t  \"encrypt_code\":\"" . $code . "\"\r\n\t\t}";
        goto yaWHf;
        Mwznt:
        return $res["content"];
        goto AHVD2;
        mPVnv:
        $url = "https://api.weixin.qq.com/card/code/decrypt?access_token=" . $access_token;
        goto usbbE;
        usbbE:
        load()->func("communication");
        goto dDmFA;
        AHVD2:
    }
    public function doPageAddcardAndmii()
    {
        goto fA82i;
        iCYtp:
        $card_type = $_GPC["card_type"];
        goto qhOrv;
        yeGiW:
        gQVTw:
        goto x3ODc;
        NcDh9:
        $user = pdo_get("mii_ang_user", array("uPassword" => md5($_W["openid"])), array("uid", "uPhone", "uName"));
        goto wQfWQ;
        x3ODc:
        $code = array("status" => "-1", "msg" => "卡券不存在");
        goto Dx21G;
        fa85Y:
        $code = array("status" => "1", "msg" => "恭喜！领取卡券成功", "card_on" => $code_on);
        goto FFv_D;
        sB2jw:
        if (!$card["quantity"]) {
            goto TNEi6;
        }
        goto lz0Hz;
        uER5f:
        $code = array("status" => "2", "msg" => "请先注册绑定!");
        goto caKAO;
        a8U4t:
        $data = array("uid" => $user["uid"], "uniacid" => $_W["uniacid"], "cid" => $cid, "card_id" => $card_id, "card_type" => $card_type, "card_on" => $card_on, "addtime" => $_W["timestamp"], "roof" => "MII");
        goto Er0a4;
        QoU_1:
        $card_on = $_GPC["card_on"];
        goto iCYtp;
        SLf9Q:
        if (empty($user["uid"])) {
            goto V9p7b;
        }
        goto wYaP5;
        usQGm:
        pdo_update("mii_ang_card", array("quantity -=" => "1"), array("id" => $cid));
        goto fa85Y;
        wYaP5:
        if (empty($user["uPhone"]) || empty($user["uName"])) {
            goto JZCoB;
        }
        goto aW5FP;
        NCAS4:
        $code = array("status" => "-1", "msg" => "该卡券库存不足");
        goto ehbPP;
        lz0Hz:
        $data = array();
        goto a8U4t;
        qhOrv:
        $code = new Ucode(random(5, true), substr($card_type, 0, 2));
        goto XazUh;
        xby7H:
        O0MyB:
        goto pAlJZ;
        caKAO:
        return json_encode($code);
        goto sYk3c;
        hEFxW:
        $code = array("status" => "-1", "领取失败，请通知管理员");
        goto rNboX;
        G36gv:
        $user["uid"] = pdo_insertid();
        goto riJ8t;
        kLurp:
        mUiF6:
        goto Xd0kM;
        z8edw:
        goto mUiF6;
        goto DfRiU;
        Dx21G:
        return json_encode($code);
        goto fue6i;
        RXMqk:
        xn0gX:
        goto jA1lQ;
        wgIbl:
        TNEi6:
        goto NCAS4;
        bJ2eF:
        JZCoB:
        goto uER5f;
        r7PSe:
        goto O0MyB;
        goto VyXAH;
        Z80rr:
        if ($ins) {
            goto l9uvg;
        }
        goto hEFxW;
        za1bU:
        goto O0MyB;
        goto wgIbl;
        a9xNZ:
        $card_id = $_GPC["card_id"];
        goto QoU_1;
        ehbPP:
        return json_encode($code);
        goto xby7H;
        wQfWQ:
        $mcardNum = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename("mii_ang_ucard") . "WHERE uniacid=:uniacid AND uid=:uid AND cid=:cid ", array(":uniacid" => $_W["uniacid"], ":uid" => $user["uid"], ":cid" => $cid));
        goto k1dc9;
        HU3MP:
        $ins = pdo_insert("mii_ang_user", $data);
        goto G36gv;
        Xd0kM:
        goto O0MyB;
        goto BHoo_;
        WTyGb:
        $cid = $_GPC["iid"];
        goto a9xNZ;
        eZITF:
        return json_encode($code);
        goto za1bU;
        TZOSp:
        $data = array("uniacid" => $_W["uniacid"], "uPassword" => md5($_W["openid"]));
        goto HU3MP;
        V85_Q:
        $code = array("status" => "-1", "msg" => "该卡券已经过期");
        goto eZITF;
        BHoo_:
        V9p7b:
        goto TZOSp;
        fue6i:
        goto O0MyB;
        goto RXMqk;
        zDUtK:
        if ($_W["timestamp"] > $card["endtime"]) {
            goto mrgly;
        }
        goto sB2jw;
        sYk3c:
        goto O0MyB;
        goto yeGiW;
        DfRiU:
        l9uvg:
        goto usQGm;
        rQt0o:
        return json_encode($code);
        goto r7PSe;
        FFv_D:
        return json_encode($code);
        goto kLurp;
        jA1lQ:
        $code = array("status" => "-1", "msg" => "个人领取次数已达到限制");
        goto rQt0o;
        ZcZdG:
        if ($card["get_limit"] <= $mcardNum) {
            goto xn0gX;
        }
        goto zDUtK;
        fA82i:
        global $_W, $_GPC;
        goto WTyGb;
        VyXAH:
        mrgly:
        goto V85_Q;
        XazUh:
        $code_on = $code->code_on();
        goto NcDh9;
        riJ8t:
        goto O0MyB;
        goto bJ2eF;
        aW5FP:
        if (empty($card["id"])) {
            goto gQVTw;
        }
        goto ZcZdG;
        rNboX:
        return json_encode($code);
        goto z8edw;
        k1dc9:
        $card = pdo_get("mii_ang_card", array("id" => $cid), array("id", "get_limit", "endtime", "quantity"));
        goto SLf9Q;
        Er0a4:
        $ins = pdo_insert("mii_ang_ucard", $data);
        goto Z80rr;
        pAlJZ:
    }
    public function getToken()
    {
        goto sRdAK;
        bV9a_:
        $res = curl_exec($curl);
        goto Y2uhe;
        AD9J0:
        $curl = curl_init();
        goto HGhYw;
        rfv0o:
        return $data["access_token"];
        goto EbWjo;
        dTpwt:
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        goto bV9a_;
        Y2uhe:
        curl_close($curl);
        goto XNSrX;
        HGhYw:
        curl_setopt($curl, CURLOPT_URL, $url);
        goto HTP2C;
        zEBXc:
        $mpinfo = pdo_get("mii_ang_setting", array("uniacid" => $_W["uniacid"]), array("appid", "appsecret"));
        goto tY2SZ;
        l5B4V:
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        goto dTpwt;
        tY2SZ:
        $appid = $mpinfo["appid"];
        goto mYP95;
        HTP2C:
        curl_setopt($curl, CURLOPT_HEADER, flase);
        goto LLMUG;
        LLMUG:
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        goto DEICn;
        XNSrX:
        $data = json_decode($res, true);
        goto rfv0o;
        mYP95:
        $secret = $mpinfo["appsecret"];
        goto Xz3Ot;
        sRdAK:
        global $_W;
        goto zEBXc;
        DEICn:
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        goto l5B4V;
        Xz3Ot:
        $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $appid . "&secret=" . $secret;
        goto AD9J0;
        EbWjo:
    }
    public function App_getToken()
    {
        goto c7I23;
        c7I23:
        global $_W;
        goto cwgAI;
        cEnMP:
        curl_close($curl);
        goto s0IWV;
        AdwpP:
        $res = curl_exec($curl);
        goto cEnMP;
        s0IWV:
        $data = json_decode($res, true);
        goto H0CDh;
        cwgAI:
        $appid = $_W["account"]["key"];
        goto f4HBF;
        Hsew2:
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        goto AdwpP;
        f4HBF:
        $secret = $_W["account"]["secret"];
        goto duiNT;
        fceZI:
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        goto Hsew2;
        z72c5:
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
        goto fceZI;
        H0CDh:
        return $data["access_token"];
        goto ySUvi;
        knYKr:
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        goto z72c5;
        AIh41:
        curl_setopt($curl, CURLOPT_HEADER, flase);
        goto knYKr;
        duiNT:
        $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $appid . "&secret=" . $secret;
        goto IqRvp;
        mRy4T:
        curl_setopt($curl, CURLOPT_URL, $url);
        goto AIh41;
        IqRvp:
        $curl = curl_init();
        goto mRy4T;
        ySUvi:
    }
    public function getCard($card_id, $openid)
    {
        goto McveU;
        IL9AA:
        $timestamp = $now;
        goto L9WY9;
        gwl8G:
        foreach ($arr as $temp) {
            $sortString = $sortString . $temp;
            KNjL3:
        }
        goto BTJxD;
        V1rnQ:
        return $cardArry;
        goto ohimh;
        CezlY:
        asort($arr, SORT_STRING);
        goto KYgi7;
        MCm3R:
        $access_token = $this->getToken();
        goto uDD6H;
        ci6os:
        $signature = sha1($sortString);
        goto NZrHc;
        L9WY9:
        $nonceStr = $this->createNonceStr(8);
        goto UeB2s;
        NZrHc:
        $cardArry = array("code" => '', "openid" => $openid, "timestamp" => $now, "signature" => $signature, "cardId" => $card_id, "ticket" => $ticket, "nonceStr" => $nonceStr);
        goto V1rnQ;
        XqLsP:
        $now = $_W["timestamp"];
        goto IL9AA;
        fZfbi:
        $arr = array($card_id, $ticket, $nonceStr, $openid, $timestamp);
        goto CezlY;
        UeB2s:
        $card_id = $card_id;
        goto G3uHE;
        KYgi7:
        $sortString = '';
        goto gwl8G;
        McveU:
        global $_W, $_GPC;
        goto MCm3R;
        G3uHE:
        $openid = $openid;
        goto fZfbi;
        BTJxD:
        lADBk:
        goto ci6os;
        uDD6H:
        $ticket = $this->getApiTicket($access_token);
        goto XqLsP;
        ohimh:
    }
    private function getApiTicket($access_token)
    {
        goto IE_Z6;
        Xj5CJ:
        $apiticket = $res["ticket"];
        goto BOgD8;
        XoQ7i:
        $mtzlh = !empty($apiticket);
        goto hvpOf;
        T2amD:
        $cookiename = "wx{$w}a{$w}pi{$w}ti{$w}ck{$w}et";
        goto VjfTR;
        fuvGp:
        $res = json_decode($res["content"], true);
        goto tppVK;
        hvpOf:
        if ($mtzlh) {
            goto QbuE2;
        }
        goto edMCe;
        AhcEK:
        QbuE2:
        goto eKZQj;
        CPTej:
        $w = $_W["uniacid"];
        goto T2amD;
        HK6DO:
        DMAR2:
        goto ABihV;
        YDpwu:
        goto Cp2hu;
        goto HK6DO;
        bN1rq:
        $res = ihttp_get($url);
        goto fuvGp;
        BOgD8:
        Cp2hu:
        goto AhcEK;
        ABihV:
        setcookie($cookiename, $res["ticket"], time() + $res["expires_in"]);
        goto Xj5CJ;
        lZuWv:
        message("获取api_ticket失败：" . $res["errmsg"]);
        goto YDpwu;
        tppVK:
        if (!empty($res["ticket"])) {
            goto DMAR2;
        }
        goto lZuWv;
        sThcy:
        load()->func("communication");
        goto bN1rq;
        VjfTR:
        $apiticket = $_COOKIE[$cookiename];
        goto XoQ7i;
        IE_Z6:
        global $_W, $_GPC;
        goto CPTej;
        edMCe:
        $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$access_token}&type=wx_card";
        goto sThcy;
        eKZQj:
        return $apiticket;
        goto SRxP9;
        SRxP9:
    }
    private function createNonceStr($length = 16)
    {
        goto aQxZL;
        QJueB:
        return $str;
        goto NWqNE;
        aQxZL:
        $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        goto IFYda;
        IFYda:
        $str = '';
        goto NWvDQ;
        Z115l:
        zHLjT:
        goto rAzGz;
        cuxCP:
        UNNPR:
        goto QJueB;
        Ib_KG:
        goto PQ_qN;
        goto cuxCP;
        Wdeep:
        PQ_qN:
        goto Yk6Cj;
        lYc_V:
        $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
        goto Z115l;
        NWvDQ:
        $i = 0;
        goto Wdeep;
        rAzGz:
        $i++;
        goto Ib_KG;
        Yk6Cj:
        if (!($i < $length)) {
            goto UNNPR;
        }
        goto lYc_V;
        NWqNE:
    }
    public function fetchCards($card_id)
    {
        goto WvWvs;
        VDxia:
        return $token;
        goto LUYOk;
        w0Dkq:
        WOyx3:
        goto U3iBA;
        HA3VT:
        $url = "https://api.weixin.qq.com/card/get?access_token={$token}";
        goto Bj5GQ;
        AUaul:
        Lz7aG:
        goto OeDXg;
        NTc71:
        $apJqD = !is_error($response);
        goto qmCtE;
        lcVXR:
        goto Lz7aG;
        goto Lp6eQ;
        gzZmZ:
        return error(-1, "访问微信接口错误, 错误代码: {$result["errcode"]}, 错误信息: {$result["errmsg"]},错误详情：{$this->error_code($result["errcode"])}");
        goto AUaul;
        WvWvs:
        $token = $this->getToken();
        goto julST;
        NV6d_:
        $response = ihttp_request($url, json_encode($data));
        goto NTc71;
        Hp9eL:
        $data = array("card_id" => $card_id);
        goto HA3VT;
        Pb2Tw:
        return error(-1, "接口调用失败, 元数据: {$response["meta"]}");
        goto kxs6v;
        U3iBA:
        $result = @json_decode($response["content"], true);
        goto WK1T5;
        Bj5GQ:
        load()->func("communication");
        goto NV6d_;
        xhip1:
        if (!empty($result["errcode"])) {
            goto lA8IS;
        }
        goto lcVXR;
        fHflo:
        return error(-1, "访问公众平台接口失败, 错误: {$response["message"]}");
        goto w0Dkq;
        OeDXg:
        return $result["card"];
        goto MisO7;
        WK1T5:
        if (empty($result)) {
            goto yVuLS;
        }
        goto xhip1;
        julST:
        $h9tof = !is_error($token);
        goto zOOyJ;
        kxs6v:
        goto Lz7aG;
        goto B19e7;
        qmCtE:
        if ($apJqD) {
            goto WOyx3;
        }
        goto fHflo;
        B19e7:
        lA8IS:
        goto gzZmZ;
        Lp6eQ:
        yVuLS:
        goto Pb2Tw;
        LUYOk:
        S7d6r:
        goto Hp9eL;
        zOOyJ:
        if ($h9tof) {
            goto S7d6r;
        }
        goto VDxia;
        MisO7:
    }
    public function doPageMemberbind()
    {
        goto K0jN2;
        xrKI8:
        $code = json_encode(array("status" => "2", "msg" => "非法操作"));
        goto jFbOl;
        IoxHV:
        $uname = $_GPC["uname"];
        goto z_6SE;
        UU35a:
        ePiki:
        goto Jz3lV;
        E3uo8:
        if ($up) {
            goto pXWhY;
        }
        goto pQ0pJ;
        QN8Zl:
        $up = pdo_update("mii_ang_user", $data, array("uid" => $uid, "uniacid" => $_W["uniacid"]));
        goto E3uo8;
        bBFAj:
        if ($uid) {
            goto Rcvku;
        }
        goto xrKI8;
        V_46f:
        $uid = $u["uid"];
        goto IoxHV;
        WqnRQ:
        goto KF1SE;
        goto PKE5Z;
        K0jN2:
        global $_W, $_GPC;
        goto X6NZ2;
        z_6SE:
        $uphone = $_GPC["uphone"];
        goto a85rq;
        vpBFH:
        pXWhY:
        goto UHORO;
        X6NZ2:
        $u = pdo_get("mii_ang_user", array("uPassword" => md5($_W["openid"])), array("uid"));
        goto V_46f;
        X4NpT:
        die($code);
        goto aau79;
        Jz3lV:
        KF1SE:
        goto IpUVO;
        UHORO:
        $code = json_encode(array("status" => "1", "msg" => "绑定成功！"));
        goto Vwv2G;
        DvxGU:
        $data = array("uName" => $uname, "uPhone" => $uphone, "nickname" => $nickname);
        goto bBFAj;
        a85rq:
        $nickname = $_GPC["nickname"];
        goto DvxGU;
        jFbOl:
        die($code);
        goto WqnRQ;
        aau79:
        goto ePiki;
        goto vpBFH;
        Vwv2G:
        die($code);
        goto UU35a;
        PKE5Z:
        Rcvku:
        goto QN8Zl;
        pQ0pJ:
        $code = json_encode(array("status" => "2", "msg" => "绑定失败！"));
        goto X4NpT;
        IpUVO:
    }
    public function doPageGettechlist()
    {
        goto r_tNw;
        q0yj1:
        r0hQ4:
        goto yYYYx;
        T4a_n:
        goto juw4X;
        goto dy46I;
        ayhuu:
        foreach ($tech as $t) {
            goto vfohi;
            PXJN9:
            TzGnX:
            goto toQTi;
            ZhOKM:
            goto TzGnX;
            goto j9cgF;
            z4nk5:
            $techArr[] = array("id" => $t["id"], "avatar" => $t["avatar"], "tname" => $t["tname"], "leve" => $t["leve"], "leve_color" => $t["leve_color"], "skill" => @array_slice(explode("||", $t["skill"]), 0, 3));
            goto PXJN9;
            toQTi:
            CiXxK:
            goto vF1Bq;
            j9cgF:
            vta2Q:
            goto z4nk5;
            vfohi:
            if ($t["skill"]) {
                goto vta2Q;
            }
            goto rlL_N;
            rlL_N:
            $techArr[] = array("id" => $t["id"], "avatar" => $t["avatar"], "tname" => $t["tname"], "leve" => $t["leve"], "leve_color" => $t["leve_color"]);
            goto ZhOKM;
            vF1Bq:
        }
        goto hV3q4;
        sKAez:
        zFt7w:
        goto nuyp6;
        iAkBx:
        if ($tid == "0") {
            goto zFt7w;
        }
        goto qqZB2;
        XwG39:
        $pindex = max(1, intval($page));
        goto Pxwr3;
        r_tNw:
        global $_W, $_GPC;
        goto pKn2l;
        pKn2l:
        $tid = $_GPC["tid"] == "all" ? "0" : $_GPC["tid"];
        goto iAkBx;
        dy46I:
        f4A6w:
        goto iAKTd;
        zxawy:
        lW5Xi:
        goto StetS;
        nuyp6:
        $sotid = '';
        goto fvAi3;
        U_iwj:
        goto lW5Xi;
        goto q0yj1;
        JSSEb:
        return json_encode($rescode);
        goto picPi;
        YHqKg:
        $techArr = "0";
        goto T4a_n;
        ooZ_E:
        $sql = "SELECT id,tname,avatar,leve,leve_color,skill FROM" . tablename("mii_ang_tech") . "WHERE uniacid={$_W["uniacid"]} AND status = 1 {$sotid} ORDER BY orderid DESC LIMIT " . ($pindex - 1) * $psize . "," . $psize;
        goto byCaC;
        bhdt0:
        juw4X:
        goto WuASD;
        F4vS9:
        $techArr = change_medias($techArr, "avatar");
        goto bhdt0;
        iAKTd:
        $techArr = array();
        goto ayhuu;
        YpkNi:
        $page = $_GPC["page"];
        goto XwG39;
        HKz4C:
        $total = pdo_fetchcolumn($countSql);
        goto kik1m;
        Pxwr3:
        $psize = 5;
        goto ooZ_E;
        pAx5F:
        $show = "true";
        goto U_iwj;
        kik1m:
        $pager = pagination($total, $pindex, $psize, $url = '', $context = array("before" => 1, "after" => 1, "ajaxcallback" => '', "callbackfuncname" => ''));
        goto wyLuv;
        wyLuv:
        $pagenum = ceil($total / $psize);
        goto ep1Hx;
        fvAi3:
        Pmpsb:
        goto YpkNi;
        WuASD:
        $rescode = array("status" => 1, "tech" => $techArr, "show" => $show);
        goto JSSEb;
        yYYYx:
        $show = "false";
        goto zxawy;
        qqZB2:
        $sotid = " AND FIND_IN_SET(" . $tid . ",classid)";
        goto Nrqdw;
        WSkHt:
        $countSql = "SELECT COUNT(*)FROM " . tablename("mii_ang_tech") . "WHERE uniacid={$_W["uniacid"]} AND status = 1 {$sotid} ORDER BY orderid DESC";
        goto HKz4C;
        hV3q4:
        csPhX:
        goto F4vS9;
        ep1Hx:
        if ($page == $pagenum || empty($tech)) {
            goto r0hQ4;
        }
        goto pAx5F;
        Nrqdw:
        goto Pmpsb;
        goto sKAez;
        byCaC:
        $tech = pdo_fetchall($sql);
        goto WSkHt;
        StetS:
        if (!empty($tech)) {
            goto f4A6w;
        }
        goto YHqKg;
        picPi:
    }
    public function doPageGettechdetails()
    {
        goto q_wm_;
        vOCXK:
        @(include MODULE_ROOT . "/public/pageinfo/techPage." . $_W["uniacid"] . ".php");
        goto bCzed;
        bCzed:
        $tid = $_GPC["tid"];
        goto kRiDe;
        yHqXD:
        $tname = $techInfo["tname"];
        goto dmzze;
        yj870:
        if ($techInfo["message"]) {
            goto WUG2n;
        }
        goto CRzxT;
        Zzm8a:
        IkP6l:
        goto vlq0n;
        Esus_:
        die("参数错误");
        goto NydES;
        XF3nH:
        XS3fm:
        goto FjCjT;
        CRzxT:
        $message = "0";
        goto iYXJj;
        qcXQf:
        K3uSd:
        goto wFgUd;
        C42Ux:
        $resdata = array("id" => $techInfo["id"], "praise" => $praise, "skill" => $skill, "fabulous" => $fabulous, "message" => $message, "opusNum" => $opusNum, "tname" => $tname, "avatar" => $avatar, "leve" => $leve, "leve_color" => $leve_color);
        goto jcg4w;
        FjCjT:
        $imagelist = explode(",", $techInfo["opus"]);
        goto STXXr;
        Fy8HJ:
        $skill = explode("||", $techInfo["skill"]);
        goto GkOnT;
        STXXr:
        $images = '';
        goto UwtIk;
        mVdui:
        nRMFc:
        goto kDr7c;
        vlq0n:
        $praise = $techInfo["praise"] . "%";
        goto iMa_1;
        sTqsb:
        $message = $techInfo["message"];
        goto qcXQf;
        y_GcM:
        $skill = "0";
        goto sCWV4;
        D94iy:
        if ($hMtCX) {
            goto UaNsY;
        }
        goto Z8hE5;
        xfv1e:
        $fabulous = $techInfo["fabulous"];
        goto yj870;
        Z8hE5:
        foreach ($imagelist as $key => $img) {
            $images[] = $_W["attachurl"] . $img;
            Yll64:
        }
        goto mVdui;
        cN0wQ:
        if ($techInfo["opus"]) {
            goto XS3fm;
        }
        goto tPmCq;
        jcg4w:
        return json_encode(array("title" => $techPage["detailstitle"] == '' ? $resdata["tname"] : $techPage["detailstitle"], "techInfo" => $resdata, "imagelist" => $imagelist, "attachurl" => $_W["attachurl"]));
        goto uxk5v;
        MhF5c:
        $leve_color = $techInfo["leve_color"];
        goto C42Ux;
        GkOnT:
        FrSrk:
        goto xfv1e;
        W_xkX:
        rSSXU:
        goto Fy8HJ;
        iYXJj:
        goto K3uSd;
        goto lf1zG;
        kDr7c:
        UaNsY:
        goto j2ave;
        iMa_1:
        if ($techInfo["skill"]) {
            goto rSSXU;
        }
        goto y_GcM;
        lf1zG:
        WUG2n:
        goto sTqsb;
        q_wm_:
        global $_W, $_GPC;
        goto vOCXK;
        SyW9N:
        goto IkP6l;
        goto XF3nH;
        sCWV4:
        goto FrSrk;
        goto W_xkX;
        YQ6bO:
        $leve = $techInfo["leve"];
        goto MhF5c;
        NydES:
        VcxxP:
        goto KnDy7;
        tPmCq:
        $imagelist = "0";
        goto SyW9N;
        cBNq4:
        if ($aOd53) {
            goto VcxxP;
        }
        goto Esus_;
        UwtIk:
        $hMtCX = empty($imagelist);
        goto D94iy;
        j2ave:
        $imagelist = $images;
        goto Zzm8a;
        KnDy7:
        $techInfo = pdo_get("mii_ang_tech", array("id" => $tid));
        goto cN0wQ;
        dmzze:
        $avatar = $techInfo["avatar"];
        goto YQ6bO;
        wFgUd:
        $opusNum = count($imagelist);
        goto yHqXD;
        kRiDe:
        $aOd53 = !empty($tid);
        goto cBNq4;
        uxk5v:
    }
    public function doPageFabulous()
    {
        goto owcPR;
        tMll7:
        $code = json_encode(array("status" => "1", "msg" => "点赞成功"));
        goto AXNm5;
        Eb68K:
        XrCuR:
        goto gC6RB;
        Q5FVH:
        iAjNt:
        goto EKosV;
        oVudR:
        goto iAjNt;
        goto bPOl2;
        v9qaA:
        if ($up) {
            goto T5RM7;
        }
        goto C0sa8;
        bPOl2:
        T5RM7:
        goto tMll7;
        RylhH:
        if (!$tid) {
            goto XrCuR;
        }
        goto Xn5O1;
        EKosV:
        goto K013c;
        goto Eb68K;
        owcPR:
        global $_W, $_GPC;
        goto CmLLi;
        WRZjK:
        K013c:
        goto lKezl;
        C0sa8:
        $code = json_encode(array("status" => "2", "msg" => "点赞失败"));
        goto LvA4U;
        dbcUD:
        die($code);
        goto WRZjK;
        AXNm5:
        die($code);
        goto Q5FVH;
        LvA4U:
        die($code);
        goto oVudR;
        gC6RB:
        $code = json_encode(array("status" => "2", "msg" => "非法操作"));
        goto dbcUD;
        Xn5O1:
        $up = pdo_update("mii_ang_tech", array("fabulous +=" => 1), array("id" => $tid));
        goto v9qaA;
        CmLLi:
        $tid = $_GPC["tid"];
        goto RylhH;
        lKezl:
    }
    private function buildOrderPayData($order)
    {
        goto E7KwL;
        ufe64:
        $datas["tid"] = $order["orderid"];
        goto gi_NC;
        LHszL:
        $datas["fee"] = $order["price"];
        goto WNy1G;
        gi_NC:
        $datas["user"] = $order["openid"];
        goto LHszL;
        WNy1G:
        $datas["title"] = $order["title"];
        goto E_5LK;
        E7KwL:
        $datas = array();
        goto ufe64;
        E_5LK:
        return $datas;
        goto L1DNv;
        L1DNv:
    }
    public function createOrderId($uid)
    {
        goto V5PDn;
        EbELA:
        return $orderid;
        goto adS3p;
        MmnSs:
        $randNum = random(8, true);
        goto mI41e;
        V5PDn:
        $randNum = '';
        goto MmnSs;
        mI41e:
        $orderid = $uid . "00" . $randNum;
        goto EbELA;
        adS3p:
    }
    public function doPageGetorderdetails()
    {
        goto aAMaD;
        KU0tl:
        $o["details"] = json_decode($o["details"], true);
        goto MxeEN;
        d9i35:
        return $this->result(0, "获取成功", $o);
        goto rroRR;
        MxeEN:
        $o["addtime"] = date("Y-m-d H:i:s", $o["addtime"]);
        goto CWL6X;
        yLCdC:
        $sql = "SELECT o.oid,o.orderid,o.is_pay,o.is_ok,o.goods_money,o.pay_money,o.tmoney,o.card_price,o.title,o.details,o.addtime,o.order_type,o.ok_time,g.id,g.goodsname,g.titlepic,g.summary FROM" . tablename("mii_ang_order") . " o LEFT JOIN " . tablename("mii_ang_goods") . " g ON o.goods_id=g.id WHERE o.uniacid=:uniacid AND o.oid=:oid";
        goto UimQF;
        CWL6X:
        $o["details"]["booktime"] = date("Y/m/d H:i", $o["details"]["starttime"]) . "-" . date("H:i", $o["details"]["endtime"]);
        goto TU4kQ;
        v58xp:
        BTYmj:
        goto KU0tl;
        PxNR6:
        $oid = $_GPC["oid"];
        goto yLCdC;
        TU4kQ:
        $o["discountmoney"] = $o["card_price"];
        goto deNRg;
        ea8yD:
        return json_encode(array("erron" => -1, "msg" => "订单不存在"));
        goto hrANO;
        rroRR:
        CkuC0:
        goto uvkuS;
        hrANO:
        goto CkuC0;
        goto v58xp;
        f67ko:
        if (!empty($o) && !empty($o["details"])) {
            goto BTYmj;
        }
        goto ea8yD;
        UimQF:
        $o = pdo_fetch($sql, array(":uniacid" => $_W["uniacid"], ":oid" => $oid));
        goto f67ko;
        FZko1:
        $o["attachurl"] = $_W["attachurl"];
        goto d9i35;
        aAMaD:
        global $_W, $_GPC;
        goto PxNR6;
        deNRg:
        $o["on_money"] = number_format($o["tmoney"] - $o["pay_money"], 2);
        goto FZko1;
        uvkuS:
    }
    public function doPageMcardInfo()
    {
        goto NpUsT;
        yXM3u:
        $mcard = array("uniacid" => $this->uniacid, "uid" => intval($uid), "name" => '', "phone" => '', "activation" => "-1", "mcard_on" => $mcard_on, "status" => 1);
        goto Fg6S3;
        MI82m:
        if ($uid) {
            goto LD_W6;
        }
        goto ROdQm;
        eIlLa:
        HOfsV:
        goto XZXAk;
        t9ydT:
        $mcard = pdo_get("mii_ang_mcard", array("uid" => $uid));
        goto WPplA;
        nsZRU:
        return json_encode(array("status" => 1, "Resdata" => $mcard, "level" => $level, "activation" => $activation, "activation_money" => $activation_money, "description" => $description, "msg" => "请先激活绑定会员卡", "loginStatus" => 1));
        goto yDch3;
        a2E29:
        $this->result(-1, "改商家未开启会员卡功能");
        goto eIlLa;
        XZXAk:
        $activation = $info["activation"];
        goto VNSMM;
        wnVfL:
        $TQvQo = !($mcard_status != "1");
        goto lpZ60;
        aztX2:
        return json_encode(array("status" => 1, "Resdata" => $mcard, "level" => $level, "activation" => $activation, "activation_money" => $activation_money, "description" => $description, "loginStatus" => 1));
        goto AC23m;
        FcQkO:
        Tq3UC:
        goto iyfPv;
        FmG_3:
        $uid = '';
        goto nWfHO;
        NpUsT:
        @(include MODULE_ROOT . "/public/mcard/mcardinfo." . $this->uniacid . ".php");
        goto FOvxy;
        ROdQm:
        return json_encode(array("status" => -1, "loginStatus" => -1));
        goto cHIH6;
        NYnAo:
        $description = $info["description"];
        goto x8su6;
        pgIn4:
        LD_W6:
        goto t9ydT;
        x8su6:
        $mcard_on = $this->mcardNumber($uid);
        goto Q1gWr;
        WLxDL:
        KgEP4:
        goto xknVg;
        AC23m:
        b2wI7:
        goto FcQkO;
        cHIH6:
        goto Tq3UC;
        goto pgIn4;
        TtTPK:
        $description = array("没有发布的事项");
        goto zng8S;
        Fg6S3:
        pdo_insert("mii_ang_mcard", $mcard);
        goto nsZRU;
        TiMuV:
        AplKu:
        goto MI82m;
        oqFpx:
        $info = $mcardinfo;
        goto FmG_3;
        xknVg:
        $description = explode("||", $description);
        goto TiMuV;
        nWfHO:
        $uid = $this->uid;
        goto Nd14c;
        yDch3:
        goto b2wI7;
        goto YMZ5j;
        VNSMM:
        $activation_money = $info["activation_money"];
        goto NYnAo;
        zng8S:
        goto AplKu;
        goto WLxDL;
        WPplA:
        $level = $this->memberlevel($info, $mcard["consumption"]);
        goto Wbnuq;
        Q1gWr:
        if ($description) {
            goto KgEP4;
        }
        goto TtTPK;
        YMZ5j:
        z72cO:
        goto aztX2;
        lpZ60:
        if ($TQvQo) {
            goto HOfsV;
        }
        goto a2E29;
        Wbnuq:
        if (!empty($mcard)) {
            goto z72cO;
        }
        goto yXM3u;
        FOvxy:
        $info = '';
        goto oqFpx;
        Nd14c:
        $mcard_status = $info["status"];
        goto wnVfL;
        iyfPv:
    }
    private function mcardNumber($uid)
    {
        $on = new memberNumber($uid);
        return $on->code_on();
    }
    private function memberlevel($info, $m)
    {
        goto YZxYe;
        LEYub:
        if ($CLkUs) {
            goto MA7Kl;
        }
        goto iql72;
        iql72:
        return false;
        goto YifNZ;
        OhE2x:
        $df_level = array("mcard_level_level" => "0", "mcard_level_name" => $arr["default_mcard_level_name"], "mcard_level_discount" => $arr["default_mcard_level_discount"]);
        goto vdwhM;
        cfBx9:
        $islevel = $arr["islevel"];
        goto OhE2x;
        YifNZ:
        MA7Kl:
        goto WWO3K;
        csWRs:
        if ($z1esp) {
            goto LwIyN;
        }
        goto F2B9K;
        x3Bhi:
        if ($vVOo1) {
            goto fzvz2;
        }
        goto yKgzx;
        yKgzx:
        krsort($arr["member_level_info"]);
        goto dJ0L0;
        iqXot:
        $vVOo1 = !is_array($arr["member_level_info"]);
        goto x3Bhi;
        dJ0L0:
        foreach ($arr["member_level_info"] as $key => $v) {
            goto uSkJO;
            RfmZb:
            IUWVO:
            goto fRWMi;
            fRWMi:
            KPMFE:
            goto u4ZO8;
            mZzN2:
            goto jSHDc;
            goto RfmZb;
            qpFID:
            if ($SWG_Z) {
                goto IUWVO;
            }
            goto Q8u3M;
            uSkJO:
            $SWG_Z = !(floatval($ac) >= floatval($v["mcard_level_condition"]));
            goto qpFID;
            Q8u3M:
            $arrAy = array("mcard_level_level" => $v["mcard_level_level"], "mcard_level_name" => $v["mcard_level_name"], "mcard_level_discount" => $v["mcard_level_discount"]);
            goto mZzN2;
            u4ZO8:
        }
        goto Rxa_f;
        YZxYe:
        $arr = $info;
        goto rSf3x;
        XLT8X:
        goto efLHY;
        goto ptdvG;
        Th_6f:
        if ($arrAy) {
            goto aT1Af;
        }
        goto Xfyq8;
        Xfyq8:
        return $df_level;
        goto XLT8X;
        ptdvG:
        aT1Af:
        goto bbL6i;
        yjGPU:
        efLHY:
        goto nca2i;
        oPCEc:
        fzvz2:
        goto Th_6f;
        WWO3K:
        $z1esp = !($islevel == "-1");
        goto csWRs;
        bbL6i:
        return $arrAy;
        goto yjGPU;
        rCugS:
        LwIyN:
        goto iqXot;
        vdwhM:
        $CLkUs = !empty($arr);
        goto LEYub;
        Rxa_f:
        jSHDc:
        goto oPCEc;
        F2B9K:
        return $df_level;
        goto rCugS;
        rSf3x:
        $ac = $m;
        goto cfBx9;
        nca2i:
    }
    private function upMemberlevel($uid = '', $level = '')
    {
        goto INPo4;
        xc3Zp:
        if (intval($level["mcard_level_level"]) > intval($mcard["level"])) {
            goto VKO5b;
        }
        goto VNbMB;
        otQUy:
        goto LxGO4;
        goto ltd0e;
        ltd0e:
        VKO5b:
        goto mO8Or;
        U3vBd:
        return 1;
        goto iTcvq;
        vok3k:
        wy0U4:
        goto wcx73;
        iTcvq:
        LxGO4:
        goto KPWWS;
        mO8Or:
        $upmcard = pdo_update("mii_ang_mcard", array("level" => $level["mcard_level_level"], "mcard_name" => $level["mcard_level_name"], "mcard_discount" => $level["mcard_level_discount"]), array("uid" => $uid));
        goto U3vBd;
        wcx73:
        $mcard = pdo_get("mii_ang_mcard", array("uid" => $uid), array("level", "mcard_name", "mcard_level_discount"));
        goto xc3Zp;
        ox3a1:
        TGPya:
        goto S48PF;
        S48PF:
        $E9wJf = !($level == '');
        goto zxUQ3;
        Cxn4D:
        $level = array("mcard_level_level" => "0", "mcard_level_name" => "默认会员", "mcard_level_discount" => "10");
        goto vok3k;
        VNbMB:
        return 0;
        goto otQUy;
        c7iHm:
        return -1;
        goto ox3a1;
        INPo4:
        $yES1g = !($uid == '');
        goto bh_7Z;
        zxUQ3:
        if ($E9wJf) {
            goto wy0U4;
        }
        goto Cxn4D;
        bh_7Z:
        if ($yES1g) {
            goto TGPya;
        }
        goto c7iHm;
        KPWWS:
    }
    public function doPageBinmember()
    {
        goto yzFGk;
        WmKy6:
        cache_write($orderid, $mcard_on);
        goto uRKpf;
        xDJkx:
        DWnO2:
        goto QJIZx;
        QJIZx:
        return json_encode(array("status" => "1", "type" => "ok", "msg" => "激活成功"));
        goto Nw_A3;
        Y5wY6:
        $cITLK = !($name == '' || $phone == '' || empty($uid));
        goto cqPPG;
        QjMGk:
        $phone = $_GPC["uphone"];
        goto UMFU3;
        UMFU3:
        $uid = $this->uid;
        goto jGNNq;
        OJMB2:
        $qp3QL = !($m["activation"] == "1" && empty($m["activation_money"]) || empty($m["activation"]));
        goto EXh97;
        zusmO:
        $orderData = array("orderid" => $orderid, "openid" => $_W["openid"], "price" => floatval($activation_money), "title" => "激活会员");
        goto WmKy6;
        cqPPG:
        if ($cITLK) {
            goto EsX4c;
        }
        goto JBhW2;
        mqw3M:
        goto pwTN0;
        goto YuQeT;
        Y6H7N:
        if ($lpp13) {
            goto uqRkh;
        }
        goto GEsHD;
        yzFGk:
        global $_W, $_GPC;
        goto thagL;
        KzrrI:
        uqRkh:
        goto OJMB2;
        JBhW2:
        return $this->result(-1, $uid ? "请完善绑定信息" : "用户登录不成功");
        goto i14sZ;
        Nw_A3:
        L0S4B:
        goto mqw3M;
        rxZxm:
        if ($activation == "1") {
            goto zU0Ad;
        }
        goto rdtfH;
        rdtfH:
        $updata = array("uniacid" => $uniacid, "name" => $name, "phone" => $phone, "balance" => "0.00", "consumption" => "0.00", "mcard_on" => $mcard_on, "activation" => "1", "actime" => $this->w["timestamp"], "status" => "1");
        goto EKGqA;
        V5LiJ:
        $mcard_on = $this->mcardNumber($uid);
        goto VUUaJ;
        NqTY6:
        $activation_money = $m["activation_money"];
        goto rxZxm;
        NSvii:
        pwTN0:
        goto H496x;
        VUUaJ:
        $orderid = $this->createOrderId($uid);
        goto Y5wY6;
        GEsHD:
        return json_encode(array("status" => "-1", "msg" => "商家未开启会员卡功能"));
        goto KzrrI;
        bRLqh:
        tOZuE:
        goto yQexn;
        EXh97:
        if ($qp3QL) {
            goto tOZuE;
        }
        goto JrmZF;
        thagL:
        $name = $_GPC["uname"];
        goto QjMGk;
        yQexn:
        $activation = $m["activation"];
        goto NqTY6;
        EKGqA:
        $up = pdo_update("mii_ang_mcard", $updata, array("uid" => $uid));
        goto shf1D;
        AP1nv:
        return $this->result(-1, "系统错误,请联系管理员!");
        goto BycNz;
        uRKpf:
        return json_encode(array("status" => "1", "type" => "pay", "payInfo" => $this->pay($this->buildOrderPayData($orderData)), "orderid" => $orderid));
        goto NSvii;
        Oe8f_:
        $lpp13 = !($m["status"] != "1");
        goto Y6H7N;
        mfpQn:
        $m = $mcardinfo;
        goto Oe8f_;
        mlSzK:
        @(include MODULE_ROOT . "/public/mcard/mcardinfo." . $_W["uniacid"] . ".php");
        goto mfpQn;
        YuQeT:
        zU0Ad:
        goto zusmO;
        BycNz:
        goto L0S4B;
        goto xDJkx;
        i14sZ:
        EsX4c:
        goto mlSzK;
        JrmZF:
        return json_encode(array("status" => "-1", "msg" => "站点配置错误，请联系管理员"));
        goto bRLqh;
        shf1D:
        if ($up) {
            goto DWnO2;
        }
        goto AP1nv;
        jGNNq:
        $uniacid = $this->uniacid;
        goto V5LiJ;
        H496x:
    }
    public function doPagePaybindmember()
    {
        goto D04Fz;
        QK2nV:
        goto ReU0j;
        goto xhI2T;
        Tf3vf:
        $card_on = $this->mcardNumber($uid);
        goto ufBJ2;
        MAcJn:
        Q1eui:
        goto IojN4;
        n7ZmJ:
        $orderid = $_GPC["orderid"];
        goto Tf3vf;
        xhI2T:
        d4iPe:
        goto EhCEK;
        ufBJ2:
        $oid = cache_load($orderid);
        goto o2xw2;
        ZNMf7:
        CXcoA:
        goto VqWW2;
        Shyrw:
        goto CXcoA;
        goto MAcJn;
        KrKvP:
        $phone = $_GPC["uphone"];
        goto GoUrM;
        D04Fz:
        global $_W, $_GPC;
        goto KaoMv;
        o2xw2:
        if ($_W["ispost"] && $card_on == $oid) {
            goto d4iPe;
        }
        goto MjjGR;
        N26HA:
        return json_encode(array("status" => "2", "msg" => "激活失败,请联系管理员"));
        goto Shyrw;
        GoUrM:
        $uid = $this->uid;
        goto n7ZmJ;
        EhCEK:
        $res = $this->PayBinmember($name, $phone, $uid);
        goto npmvY;
        KaoMv:
        $name = $_GPC["uname"];
        goto KrKvP;
        IojN4:
        return json_encode(array("status" => "1", "msg" => "激活成功"));
        goto ZNMf7;
        VqWW2:
        ReU0j:
        goto WcZZW;
        npmvY:
        if ($res) {
            goto Q1eui;
        }
        goto N26HA;
        MjjGR:
        return json_encode(array("status" => "2", "msg" => "非法操作"));
        goto QK2nV;
        WcZZW:
    }
    private function PayBinmember($name, $phone, $uid)
    {
        goto ES4CE;
        L22hv:
        $mcard_on = '';
        goto IBpJB;
        nN63K:
        GM7Cd:
        goto L22hv;
        tG8wU:
        return $this->result(-1, "缺少绑定数据项");
        goto nN63K;
        ES4CE:
        $TwoKP = !($name == '' || $phone == '' || $uid == '');
        goto wYzpg;
        wYzpg:
        if ($TwoKP) {
            goto GM7Cd;
        }
        goto tG8wU;
        ELj3b:
        return $res;
        goto u2MFa;
        IBpJB:
        $mcard_on = $this->mcardNumber($uid);
        goto okUMT;
        okUMT:
        $data = array("name" => $name, "phone" => $phone, "balance" => "0.00", "consumption" => "0.00", "mcard_on" => $mcard_on, "activation" => "1", "actime" => $this->w["timestamp"], "status" => "1");
        goto L0HxL;
        L0HxL:
        $res = pdo_update("mii_ang_mcard", $data, array("uid" => $uid));
        goto ELj3b;
        u2MFa:
    }
    public function doPagePaymembercard()
    {
        goto iGau3;
        ufzMi:
        $payNumber = floatval($_GPC["payNumber"]);
        goto RwtLk;
        g08bh:
        return json_encode(array("status" => "2", "msg" => "参数有误"));
        goto uceBm;
        iGau3:
        global $_W, $_GPC;
        goto DsRHl;
        MJnSF:
        $mcard_on = $this->mcardNumber($uid);
        goto BGN6m;
        uceBm:
        goto dvtzx;
        goto RjdJL;
        d2Jl_:
        $oid = $this->buildpaylog($params);
        goto MKckq;
        wASVD:
        $orderid = date("YmdHis") . "00" . random(8, 1);
        goto lcLQA;
        RwtLk:
        $orderData = '';
        goto wASVD;
        PDpBU:
        $mcard_on = '';
        goto MJnSF;
        BGN6m:
        $orderData = array("orderid" => $orderid, "openid" => $_W["openid"], "price" => floatval($payNumber), "title" => "充值会员卡");
        goto D4rJ_;
        DsRHl:
        $payNumber = '';
        goto ufzMi;
        MKckq:
        if ($payNumber && $uid && $oid && $_W["ispost"]) {
            goto bAae5;
        }
        goto g08bh;
        xmi7U:
        dvtzx:
        goto f3Lv_;
        lcLQA:
        $uid = pdo_fetchcolumn("SELECT uid FROM " . tablename("mii_ang_user") . " WHERE uPassword = :uPassword", array(":uPassword" => md5($_W["openid"])));
        goto PDpBU;
        D4rJ_:
        $payInfo = $this->buildOrderPayData($orderData);
        goto NZGDR;
        C7Qe7:
        return json_encode(array("status" => "1", "payInfo" => $this->pay($payInfo), "oid" => $oid));
        goto xmi7U;
        RjdJL:
        bAae5:
        goto C7Qe7;
        NZGDR:
        $params = array("openid" => $_W["openid"], "uniontid" => $orderid, "type" => "recharge_mcard", "fee" => floatval($payNumber), "mcard_on" => $mcard_on);
        goto d2Jl_;
        f3Lv_:
    }
    private function buildpaylog($params)
    {
        goto VVd4c;
        mmv8j:
        $data = array("uniacid" => $this->uniacid, "openid" => $params["openid"], "uniontid" => $params["uniontid"], "pay_type" => "WECHAT", "type" => $params["type"], "pay_type" => "wechat", "fee" => $params["fee"], "mcard_on" => $params["mcard_on"], "status" => 0, "note" => serialize(array("title" => "会员卡充值", "tmoney" => $params["fee"])), "addtime" => $this->w["timestamp"]);
        goto LTmzz;
        VVd4c:
        $O8uL_ = !(!is_array($params) || empty($params["uniontid"]) || empty($params["fee"]) || empty($params["type"]) || empty($params["mcard_on"]));
        goto Akiyw;
        Akiyw:
        if ($O8uL_) {
            goto Tyqco;
        }
        goto ffPRQ;
        StsC8:
        Tyqco:
        goto mmv8j;
        n3Rji:
        return pdo_insertid();
        goto KuImR;
        ffPRQ:
        return error(-1, "参数错误");
        goto StsC8;
        LTmzz:
        pdo_insert("mii_ang_paylog", $data);
        goto n3Rji;
        KuImR:
    }
    public function doPageCompleterechargemcard()
    {
        goto hx2xX;
        NvklG:
        if ($res) {
            goto cHaeR;
        }
        goto SEM2G;
        OLu55:
        $oid = $_GPC["oid"];
        goto ToOJI;
        TaoyZ:
        CToEW:
        goto n5r2U;
        Sg8iv:
        $res = pdo_update("mii_ang_mcard", array("balance +=" => $fee), array("mcard_on" => $order["mcard_on"]));
        goto NvklG;
        kCCBu:
        cHaeR:
        goto t22l9;
        UqUH3:
        $fee = floatval($order["fee"]) + floatval($recharge_discount_fee);
        goto aviZ7;
        t22l9:
        return $this->result(1, $recharge_discount_fee ? "充值成功,满足赠送条件,系统多送 " . $recharge_discount_fee . " 元" : "充值成功", array("status" => "1"));
        goto VO0QP;
        hx2xX:
        global $_W, $_GPC;
        goto m5EWZ;
        ToOJI:
        $order = pdo_get("mii_ang_paylog", array("oid" => $oid), array("fee", "mcard_on"));
        goto sgfvz;
        zvFzd:
        goto cvfxZ;
        goto TaoyZ;
        VfO1C:
        cvfxZ:
        goto zk7CO;
        n5r2U:
        $recharge_discount_fee = $this->recharge_discount($order["fee"]);
        goto UqUH3;
        CyE2N:
        return json_encode(array("status" => "2", "msg" => "订单有误，请及时联系网站管理员"));
        goto zvFzd;
        aviZ7:
        pdo_update("mii_ang_paylog", array("status" => "1", "give" => floatval($recharge_discount_fee), "pay_time" => $this->w["timestamp"]), array("oid" => $oid));
        goto Sg8iv;
        sgfvz:
        if ($order["fee"] && $order["mcard_on"]) {
            goto CToEW;
        }
        goto CyE2N;
        o_xGw:
        goto hln1R;
        goto kCCBu;
        m5EWZ:
        $oid = '';
        goto OLu55;
        VO0QP:
        hln1R:
        goto VfO1C;
        SEM2G:
        return json_encode(array("status" => "1", "msg" => "余额没有改变"));
        goto o_xGw;
        zk7CO:
    }
    private function recharge_discount($fee)
    {
        goto TSnpE;
        TSnpE:
        global $_W;
        goto GyVCM;
        cT_XS:
        return false;
        goto t5fJU;
        czcg_:
        if ($recharge_discount == "1") {
            goto Y9zh5;
        }
        goto cT_XS;
        gl3GO:
        $recharge_discount_info = $mcardinfo["recharge_discount_info"];
        goto dNWq4;
        fqbF3:
        return false;
        goto EXA2d;
        U70UP:
        JqyAs:
        goto CE51R;
        V7s14:
        LeMWc:
        goto YtQD_;
        xjcOM:
        goto PxGpD;
        goto ebyPR;
        ujCnX:
        return false;
        goto xjcOM;
        EXA2d:
        goto LeMWc;
        goto UJyjW;
        ho79u:
        return $give_money;
        goto V7s14;
        t5fJU:
        goto UeB_p;
        goto DR26u;
        YtQD_:
        PxGpD:
        goto hYeY5;
        CE51R:
        if ($give_money) {
            goto N1LJT;
        }
        goto fqbF3;
        eFGLk:
        $recharge_discount = $mcardinfo["recharge_discount"];
        goto gl3GO;
        xZer3:
        foreach ($recharge_discount_info as $key => $r) {
            goto FzpRT;
            FzpRT:
            $dzc7u = !(floatval($fee) >= floatval($r["condition_money"]));
            goto oBIVY;
            oBIVY:
            if ($dzc7u) {
                goto qglWu;
            }
            goto ArhkZ;
            swuo9:
            qglWu:
            goto EI9y9;
            EI9y9:
            Ire28:
            goto g_WXh;
            ArhkZ:
            $give_money = $r["give_money"];
            goto Z1JDc;
            Z1JDc:
            goto JqyAs;
            goto swuo9;
            g_WXh:
        }
        goto U70UP;
        ebyPR:
        lJ0o3:
        goto xZer3;
        AjrKI:
        if (!empty($recharge_discount_info)) {
            goto lJ0o3;
        }
        goto ujCnX;
        DR26u:
        Y9zh5:
        goto AjrKI;
        UJyjW:
        N1LJT:
        goto ho79u;
        hYeY5:
        UeB_p:
        goto F2XL_;
        dNWq4:
        $fee = $fee;
        goto czcg_;
        GyVCM:
        @(include MODULE_ROOT . "/public/mcard/mcardinfo." . $_W["uniacid"] . ".php");
        goto eFGLk;
        F2XL_:
    }
    public function doPageOnLinecheck()
    {
        goto oAbLr;
        wLJ6J:
        if ($ifTGE) {
            goto fFBwR;
        }
        goto bp48P;
        nawYR:
        @(include MODULE_ROOT . "/public/mcard/mcardinfo." . $this->w["uniacid"] . ".php");
        goto XCm4c;
        mBzok:
        goto ragfR;
        goto Deso5;
        BUCLA:
        ragfR:
        goto YdNUB;
        zs8qP:
        return $this->result(-1, "没有操作权限");
        goto mBzok;
        D2wVz:
        return $this->result(-1, "用户登录不成功!");
        goto UuuzQ;
        ronDM:
        return json_encode(array("status" => "1", "iSmcard" => $mcard["activation"] == "1" ? "1" : "-1", "balance" => $mcard["balance"], "discount" => $level["mcard_level_discount"], "mcard_on" => $mcard["mcard_on"]));
        goto o8DqZ;
        H5YZk:
        $mcard = pdo_fetch("SELECT balance,activation,consumption,mcard_on,status FROM " . tablename("mii_ang_mcard") . " WHERE  uid=:uid ", array(":uid" => $uid));
        goto P0FGS;
        B02et:
        return json_encode(array("status" => "-1", "iSmcard" => "-1"));
        goto hATLw;
        qiiQW:
        fFBwR:
        goto jV79I;
        Deso5:
        DAvGo:
        goto P_1Xk;
        XCm4c:
        $ifTGE = !empty($mcardinfo);
        goto wLJ6J;
        WJzzl:
        vf9lD:
        goto TG6Pz;
        P_1Xk:
        $uid = $this->uid;
        goto nawYR;
        o8DqZ:
        J6IQt:
        goto BUCLA;
        Utsz0:
        if ($r8fCb) {
            goto KapYa;
        }
        goto D2wVz;
        UuuzQ:
        KapYa:
        goto H5YZk;
        hATLw:
        goto J6IQt;
        goto WJzzl;
        P0FGS:
        if ($mcard) {
            goto vf9lD;
        }
        goto B02et;
        oAbLr:
        if ($this->w["ispost"]) {
            goto DAvGo;
        }
        goto zs8qP;
        bp48P:
        return $this->result(-1, "未配置参数");
        goto qiiQW;
        jV79I:
        $r8fCb = $uid;
        goto Utsz0;
        TG6Pz:
        $level = $this->memberlevel($mcardinfo, $mcard["consumption"]);
        goto ronDM;
        YdNUB:
    }
    public function doPageMoneyinputcomplete()
    {
        goto dl9_K;
        Ta0jc:
        pEgVo:
        goto YlKbX;
        qCNXq:
        $cardNum = count($cardList, 0);
        goto nfpgV;
        mppRf:
        Wd0os:
        goto OPu41;
        IwjNj:
        $cardList = pdo_fetchall("SELECT uc.card_on,uc.use,c.id,c.card_type,c.bg_color,c.title,c.starttime,c.endtime,c.time_type,c.discount,c.minus FROM " . tablename("mii_ang_ucard") . " uc LEFT JOIN " . tablename("mii_ang_card") . " c ON uc.cid = c.id WHERE uc.uid=:uid AND uc.use = :use AND uc.roof=:roof AND c.endtime >= :endtime AND c.condition <= :condition ORDER BY uc.addtime DESC ", array(":uid" => $uid, ":use" => "-1", ":roof" => "MII", ":condition" => $money, ":endtime" => $this->w["timestamp"]));
        goto qCNXq;
        HMciW:
        return json_encode(array("cardNum" => $cardNum, "cardList" => $cardList));
        goto mppRf;
        nJhzi:
        gZr44:
        goto JdOfH;
        nfpgV:
        return json_encode(array("cardNum" => $cardNum, "cardList" => $cardList));
        goto Ta0jc;
        OPu41:
        $uid = $this->uid;
        goto IwjNj;
        JdOfH:
        $money = $this->gpc["money"];
        goto dKLWL;
        i_FbP:
        if ($N_irA) {
            goto Wd0os;
        }
        goto HMciW;
        Vxnsn:
        goto pEgVo;
        goto nJhzi;
        dKLWL:
        $N_irA = !empty($money);
        goto i_FbP;
        dl9_K:
        if ($this->w["ispost"]) {
            goto gZr44;
        }
        goto WarAb;
        WarAb:
        return $this->result(-1, "没有操作权限");
        goto Vxnsn;
        YlKbX:
    }
    public function doPageOnLinecheckpay()
    {
        goto LeHOI;
        ccvY1:
        if ($eEcZH) {
            goto SCSQm;
        }
        goto X85iF;
        F4lk5:
        $orderData = array("orderid" => $orderid, "openid" => $openid, "price" => floatval($paymoney), "title" => $note);
        goto Px_x_;
        OZVyH:
        UfeGn:
        goto JGNAf;
        UWMXx:
        aMZ53:
        goto sUfIB;
        xEmtj:
        if ($oid) {
            goto uHrVG;
        }
        goto y5F40;
        zgynL:
        $card_fee = $this->gpc["card_fee"] ? $this->gpc["card_fee"] : "0";
        goto jfB9v;
        azBPS:
        return $this->result(-1, "支付类型错误");
        goto ypuXU;
        c6la5:
        $orderData = '';
        goto zJcGY;
        SluoH:
        goto JZGg_;
        goto HL0md;
        zJcGY:
        $orderid = '';
        goto I4P8T;
        unSvW:
        if ($payType == "wechat") {
            goto BxB_l;
        }
        goto qNNLq;
        jt7YS:
        $note = $this->gpc["note"];
        goto zgynL;
        ghaUh:
        $card_on = $this->gpc["card_on"];
        goto jt7YS;
        saqCi:
        $e = 0.0;
        goto UFhgp;
        UFhgp:
        $feetotal = floatval($mcard_fee) + floatval($card_fee) + floatval($paymoney);
        goto FgR5_;
        ypuXU:
        OJb2H:
        goto YUHGM;
        X85iF:
        return $this->result(-1, "消费金额应大于 0");
        goto BoLzi;
        nUFbb:
        goto SYtuf;
        goto Scsuf;
        BoLzi:
        SCSQm:
        goto msmHg;
        rJpie:
        return $this->result(-1, "没有操作权限");
        goto SluoH;
        n4s0C:
        $uid = $this->uid;
        goto uVbY_;
        YoJm8:
        $payType = $this->gpc["payType"];
        goto ONBWY;
        bV9qY:
        $mcard_on = $this->gpc["mcard_on"];
        goto ghaUh;
        qe07O:
        $payInfo = $this->pay($this->buildOrderPayData($orderData));
        goto xEmtj;
        sgDkn:
        if ($MqaW_) {
            goto UfeGn;
        }
        goto K_IUX;
        txO0h:
        if ($w5NYW) {
            goto OJb2H;
        }
        goto azBPS;
        JGNAf:
        $a2Yns = !($feetotal - floatval($tmoney) > $e);
        goto nTfMI;
        ZvlD4:
        JZGg_:
        goto vlXc3;
        qNNLq:
        if ($payType == "mcard") {
            goto sUVoX;
        }
        goto b0f6L;
        sUfIB:
        $eEcZH = !(floatval($paymoney) < 0.01);
        goto ccvY1;
        OgAZV:
        j1qu9:
        goto XO3hY;
        zPLWF:
        $tmoney = $this->gpc["tmoney"];
        goto saqCi;
        b0f6L:
        return $this->result(-1, "支付类型错误");
        goto rDemK;
        rDemK:
        goto j1qu9;
        goto bx_7U;
        Px_x_:
        $insdata = '';
        goto zLIyp;
        pU3bJ:
        sUVoX:
        goto wZzZh;
        UI5nx:
        $oid = pdo_insertid();
        goto qe07O;
        wZzZh:
        return json_encode(array("status" => "1", "oid" => $oid));
        goto OgAZV;
        bWVjF:
        return $this->result(-1, "金额不匹配" . $tmoney);
        goto f3bc7;
        K_IUX:
        return $this->result(-1, "用户异常");
        goto OZVyH;
        HL0md:
        O3T6G:
        goto n4s0C;
        I4P8T:
        $orderid = date("YmdHis") . "00" . random(8, 1);
        goto F4lk5;
        FgR5_:
        $MqaW_ = !(!$uid || !$openid);
        goto sgDkn;
        jfB9v:
        $mcard_fee = $this->gpc["mcard_fee"] ? $this->gpc["mcard_fee"] : "0";
        goto zPLWF;
        E0wSy:
        $w5NYW = !($payType != "wechat" && $payType != "mcard");
        goto txO0h;
        ONBWY:
        $paymoney = $this->gpc["paymoney"];
        goto bV9qY;
        YUHGM:
        $dCkaW = !(floatval($tmoney) < 0.01);
        goto cKB7u;
        JQjd_:
        pdo_insert("mii_ang_paylog", $insdata);
        goto UI5nx;
        XO3hY:
        SYtuf:
        goto ZvlD4;
        cKB7u:
        if ($dCkaW) {
            goto aMZ53;
        }
        goto rnCux;
        msmHg:
        $_note = serialize(array("title" => $note, "tmoney" => $tmoney));
        goto c6la5;
        Hnbk9:
        return json_encode(array("status" => "1", "payInfo" => $payInfo, "oid" => $oid));
        goto gHpmO;
        bx_7U:
        BxB_l:
        goto Hnbk9;
        nTfMI:
        if ($a2Yns) {
            goto xZkUL;
        }
        goto bWVjF;
        gHpmO:
        goto j1qu9;
        goto pU3bJ;
        y5F40:
        return $this->result(-1, "订单生成有误!");
        goto nUFbb;
        rnCux:
        return $this->result(-1, "消费金额应大于 0");
        goto UWMXx;
        zLIyp:
        $insdata = array("uniacid" => $this->uniacid, "openid" => $openid, "type" => "onlinecheck", "pay_type" => $payType, "uniontid" => $orderid, "fee" => $paymoney, "mcard_on" => $mcard_on, "mcard_fee" => $mcard_fee, "card_on" => $card_on, "card_fee" => $card_fee, "status" => "0", "note" => $_note, "addtime" => $this->w["timestamp"]);
        goto JQjd_;
        Scsuf:
        uHrVG:
        goto unSvW;
        LeHOI:
        if ($this->w["ispost"]) {
            goto O3T6G;
        }
        goto rJpie;
        uVbY_:
        $openid = $this->openid;
        goto YoJm8;
        f3bc7:
        xZkUL:
        goto E0wSy;
        vlXc3:
    }
    public function doPageOnlinecheckcomplete()
    {
        goto OKTtT;
        pi3nH:
        kYsN9:
        goto Tb26s;
        Q3y1C:
        p3k6Z:
        goto RA9UX;
        HDvw9:
        $up = pdo_update("mii_ang_paylog", array("status" => "1", "pay_time" => $time), array("oid" => $oid));
        goto jaNyh;
        B3maA:
        if ($Gs0vy) {
            goto frbMk;
        }
        goto Q5eMe;
        rjl1s:
        if (!empty($oid)) {
            goto feerO;
        }
        goto uZ8ra;
        PqO12:
        if ($ZDrrz) {
            goto X7D8A;
        }
        goto s5WOQ;
        xPALO:
        AUR4l:
        goto pitGM;
        fBaek:
        $fee = floatval($o["fee"]);
        goto mC60n;
        AEBtr:
        $uid = '';
        goto U87Cb;
        Lmlz9:
        X7D8A:
        goto gkoRO;
        izyOD:
        return $this->result(-1, "改卡券已被使用");
        goto xoltE;
        iDFXY:
        $payTime = $time;
        goto X8bcn;
        IgPAC:
        $G5acY = empty($card_on);
        goto ZwldY;
        AJmKV:
        $r = array("payStatus" => 1, "payType" => $payType, "payFee" => $fee, "payOn" => $o["uniontid"], "cardDiscount" => $o["card_fee"], "mcardDiscount" => $o["mcard_fee"], "mcardBalance" => $balance, "payTime" => $payTime);
        goto OW_r4;
        RA9UX:
        $oid = $this->gpc["oid"];
        goto EQKm9;
        jaNyh:
        if ($up) {
            goto H3r8q;
        }
        goto Xq6j3;
        FqApp:
        if ($JO7NB) {
            goto YS6qy;
        }
        goto izyOD;
        vZrvG:
        uzcZx:
        goto TvY7u;
        fuNio:
        $time = $this->w["timestamp"];
        goto rjl1s;
        mC60n:
        $mcard_on = $o["mcard_on"];
        goto J4vhz;
        J4vhz:
        $card_on = $o["card_on"];
        goto Ztg6h;
        emteP:
        return $this->result(-1, "没有操作权限");
        goto P8WOh;
        IS1Ji:
        $balance = floatval($iSbalance["balance"]) - $fee;
        goto BNV3U;
        BeBP6:
        goto AUR4l;
        goto PwYnk;
        U87Cb:
        $uid = $this->uid;
        goto ly4mt;
        aSNjK:
        $r1 = pdo_update("mii_ang_ucard", array("use" => "1"), array("uid" => $uid, "card_on" => $card_on));
        goto Jyx_P;
        s5WOQ:
        $r2 = pdo_update("mii_ang_mcard", array("consumption +=" => $fee), array("uid" => $uid, "mcard_on" => $mcard_on, "activation" => "1"));
        goto Lmlz9;
        Ztg6h:
        $note = unserialize($o["note"]);
        goto IgPAC;
        TvY7u:
        $ZDrrz = !(!empty($mcard_on) && $payType == "wechat");
        goto PqO12;
        Q5eMe:
        return $this->result(-1, "会员卡支付:会员卡功能异常");
        goto y84gM;
        gkoRO:
        $Pj1tR = !(!empty($mcard_on) && $payType == "mcard");
        goto DmKRe;
        y84gM:
        frbMk:
        goto Z6DIC;
        Z6DIC:
        qCNNu:
        goto HDvw9;
        B77jQ:
        $iSbalance = pdo_get("mii_ang_mcard", array("uid" => $uid), array("balance"));
        goto IS1Ji;
        DmKRe:
        if ($Pj1tR) {
            goto qCNNu;
        }
        goto B77jQ;
        pitGM:
        LFUEj:
        goto BnY6g;
        m2NjT:
        $r = '';
        goto iDFXY;
        OW_r4:
        return json_encode(array("status" => 1, "odata" => $r));
        goto xPALO;
        meUAp:
        return $this->result(-1, "会员卡余额不足,请先充值！");
        goto pi3nH;
        cUYKU:
        goto LFUEj;
        goto OIu0Z;
        EQKm9:
        $payType = $this->gpc["payType"];
        goto AEBtr;
        BNV3U:
        $KQhJi = !($balance < 0);
        goto acLr9;
        P8WOh:
        goto Kcj52;
        goto Q3y1C;
        Jyx_P:
        $JO7NB = $r1;
        goto FqApp;
        OKTtT:
        if ($this->w["ispost"]) {
            goto p3k6Z;
        }
        goto emteP;
        ly4mt:
        $time = '';
        goto fuNio;
        X8bcn:
        $payTime = date("Y-m-d H:i:s", $payTime);
        goto AJmKV;
        Xq6j3:
        return json_encode(array("status" => "2", "msg" => "订单生成有误状态未改变"));
        goto BeBP6;
        OIu0Z:
        feerO:
        goto sBiqm;
        ZwldY:
        if ($G5acY) {
            goto uzcZx;
        }
        goto aSNjK;
        Tb26s:
        $r3 = pdo_update("mii_ang_mcard", array("balance -=" => $fee, "consumption +=" => $fee), array("uid" => $uid, "mcard_on" => $mcard_on, "activation" => "1"));
        goto EyXvx;
        sBiqm:
        $o = pdo_get("mii_ang_paylog", array("oid" => $oid), array("uniontid", "fee", "mcard_on", "mcard_fee", "card_on", "card_fee"));
        goto fBaek;
        EyXvx:
        $Gs0vy = $r3;
        goto B3maA;
        uZ8ra:
        return $this->result(-1, "订单ID缺失,请联系管理员");
        goto cUYKU;
        xoltE:
        YS6qy:
        goto vZrvG;
        acLr9:
        if ($KQhJi) {
            goto kYsN9;
        }
        goto meUAp;
        PwYnk:
        H3r8q:
        goto m2NjT;
        BnY6g:
        Kcj52:
        goto t5kP8;
        t5kP8:
    }
    public function doPageGetmypaylog()
    {
        goto GDjL3;
        ZJQ1X:
        foreach ($paylog as $k => $pay) {
            $paylogs[] = array("oid" => $pay["oid"], "fee" => $pay["fee"], "pay_time" => date("Y-m-d H:i:s", $pay["pay_time"]), "note" => unserialize($pay["note"]));
            sNTwv:
        }
        goto I1QST;
        OIUjj:
        $psize = 4;
        goto sN06o;
        OSY7Z:
        $my50p = !$paylog;
        goto LImpm;
        EIiNE:
        $page = $this->gpc["pages"];
        goto buc0Q;
        buc0Q:
        $openid = $this->openid;
        goto ubUIz;
        YCWJz:
        return $this->result(-1, "没有操作权限");
        goto y2Qwt;
        kr_8d:
        tl9u5:
        goto gglLV;
        Xk_7M:
        $iSempty = -1;
        goto FoHza;
        VZz6i:
        $showMore = -1;
        goto kr_8d;
        wLfsx:
        return json_encode($resdata);
        goto Nvjlu;
        AjCGj:
        $resdata = '';
        goto qtky_;
        LImpm:
        if ($my50p) {
            goto LdvBZ;
        }
        goto w3Xq0;
        XLWew:
        $paylog = pdo_fetchall($sql, array(":uniacid" => $uniacid, ":openid" => $openid, ":type" => $type, ":status" => "1"));
        goto cOWce;
        qtky_:
        $resdata = array("loginStatus" => $openid ? 1 : -1, "data" => $paylog, "showMore" => $showMore, "iSempty" => $iSempty);
        goto wLfsx;
        MDDYb:
        $Ew8GX = $this->w["ispost"];
        goto IZ_4D;
        w3Xq0:
        $paylogs = '';
        goto ZJQ1X;
        gglLV:
        if ($page == "0" && empty($paylog)) {
            goto gquoQ;
        }
        goto NN05x;
        IZ_4D:
        if ($Ew8GX) {
            goto C9bhW;
        }
        goto YCWJz;
        I1QST:
        LUtWk:
        goto mK1QV;
        ph7vY:
        $pager = pagination($total, $pindex, $psize, $url = '', $context = array("before" => 1, "after" => 1, "ajaxcallback" => '', "callbackfuncname" => ''));
        goto LFAeB;
        QXyeQ:
        if ($page == $pagenum || empty($paylog)) {
            goto btYIk;
        }
        goto AuLpt;
        mK1QV:
        $paylog = $paylogs;
        goto D9WzO;
        D9WzO:
        LdvBZ:
        goto AjCGj;
        ubUIz:
        $uniacid = $this->uniacid;
        goto MDDYb;
        y2Qwt:
        C9bhW:
        goto Ww25b;
        GDjL3:
        $type = $this->gpc["typeid"];
        goto EIiNE;
        g5ctd:
        goto ifYFX;
        goto njop3;
        cOWce:
        $countSql = "SELECT COUNT(*)FROM " . tablename("mii_ang_paylog") . "WHERE uniacid=:uniacid AND openid =:openid AND type=:type AND status=:status ";
        goto X82Vm;
        Ww25b:
        $pindex = max(1, intval($page));
        goto OIUjj;
        sN06o:
        $sql = "SELECT `oid`,fee,note,addtime,pay_time FROM" . tablename("mii_ang_paylog") . "WHERE uniacid=:uniacid AND openid=:openid AND type=:type AND status=:status ORDER BY pay_time  DESC LIMIT " . ($pindex - 1) * $psize . "," . $psize;
        goto XLWew;
        FoHza:
        ifYFX:
        goto OSY7Z;
        Pna40:
        btYIk:
        goto VZz6i;
        njop3:
        gquoQ:
        goto Xk_7M;
        lTi4R:
        goto tl9u5;
        goto Pna40;
        X82Vm:
        $total = pdo_fetchcolumn($countSql, array(":uniacid" => $uniacid, ":openid" => $openid, ":type" => $type, ":status" => "1"));
        goto ph7vY;
        AuLpt:
        $showMore = 1;
        goto lTi4R;
        NN05x:
        $iSempty = 1;
        goto g5ctd;
        LFAeB:
        $pagenum = ceil($total / $psize);
        goto QXyeQ;
        Nvjlu:
    }
    public function doPageGetpaylogdetails()
    {
        goto LdDcL;
        mToYM:
        $o = pdo_get("mii_ang_paylog", array("oid" => $oid, "openid" => $openid), array("type", "pay_type", "uniontid", "fee", "mcard_fee", "card_fee", "give", "status", "note", "addtime", "pay_time"));
        goto M5Y1e;
        pfeSF:
        goto YCkf9;
        goto Jm5H6;
        ytKxt:
        GsmYG:
        goto ojuWc;
        Xq2Ea:
        return $this->result(-1, "没有操作权限");
        goto pfeSF;
        V8M_F:
        goto GsmYG;
        goto gWfHB;
        fqkPM:
        if (!empty($o)) {
            goto mh2n_;
        }
        goto entMs;
        FHCQY:
        $oid = $this->gpc["oid"];
        goto iwzBB;
        LdDcL:
        $openid = $this->openid;
        goto FHCQY;
        ojuWc:
        YCkf9:
        goto hucwd;
        gWfHB:
        mh2n_:
        goto OH0l0;
        iwzBB:
        if ($this->w["ispost"]) {
            goto kG9KN;
        }
        goto Xq2Ea;
        lJTyD:
        return json_encode(array("status" => 1, "data" => $resdata));
        goto ytKxt;
        M5Y1e:
        $Deser = unserialize($o["note"]);
        goto fqkPM;
        entMs:
        return $this->result(-1, "订单获取失败");
        goto V8M_F;
        OH0l0:
        $resdata = array("payStatus" => $o["status"], "payFee" => $o["fee"], "payType" => $o["pay_type"], "payOn" => $o["uniontid"], "cardDiscount" => $o["card_fee"], "mcardDiscount" => $o["mcard_fee"], "payGive" => $o["give"], "payTotal" => $Deser["tmoney"], "payNote" => $Deser["title"], "payAddtime" => date("Y-m-d H:i:s", $o["addtime"]), "payTime" => date("Y-m-d H:i:s", $o["pay_time"]));
        goto lJTyD;
        Jm5H6:
        kG9KN:
        goto mToYM;
        hucwd:
    }
}